S
Suzanne Wyatt
Network Blitz
Below is the current code I have in my database, thanks to some help from PC
Datasheet! Question I have is two fold, I have a checkbox called
SuccessfulContact, how and where would I put an event to 1. make the
SfrmClientResponse not visible unless the value of SuccessfulContact Check
box is true(IsNotNull) Second I would like to lock the combobox IntervalID
until SuccessfulContact is made (same checkbox) I have a main form
FrmClient with 2 subforms Sfrm Survey and Sfrm ClientResponse. All help
would be greatly appreciated. TIA Suzanne Wyatt
Private Sub Form_Current()
Me!ProgramCategoryID.Requery
Me!ProgramCategoryID.SetFocus
End Sub
Private Sub ProgramCategoryID_AfterUpdate()
Me!ProgramID.Requery
End Sub
Private Sub FindClientNum_Enter()
Me!FindClientNum.Dropdown
End Sub
Private Sub FindClientNum_AfterUpdate()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ClientID] = " & Me!FindClientNum
Me.Bookmark = Rst.Bookmark
Rst.Close
Me!FindClientNum = Null
Me!SfrmSurvey.SetFocus
Me!SfrmSurvey!IntervalID.SetFocus
End Sub
Private Sub FindClientLastName_Enter()
Me!FindClientLastName.Dropdown
End Sub
Private Sub FindClientLastName_AfterUpdate()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ClientID] = " & Me!FindClientLastName
Me.Bookmark = Rst.Bookmark
Rst.Close
Me!FindClientLastName = Null
Me!SfrmSurvey.SetFocus
Me!SfrmSurvey!IntervalID.SetFocus
End Sub
Option Compare Database
Private Sub cbxSurveyResponse_AfterUpdate()
Me!SurveyResponseID = Me!cbxSurveyResponse
Me!cbxSurveyResponse = Null
Me!SurveyID = Forms!FrmClient!SfrmSurvey!SurveyID
End Sub
Private Sub Form_Current()
Me!cbxSurveyResponse.Requery
End Sub
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
If Rst.RecordCount <> 0 Then
Rst.MoveLast
End If
' deactivate the previous button when on the first record
Me!PrevRec.Enabled = (Me.CurrentRecord <> 1)
' deactivate the next button when on the last record
Me!NextRec.Enabled = (Me.CurrentRecord < Rst.RecordCount)
If Me.NewRecord Then
Me!LblRecNum.Caption = "New"
Me!NewRec.Enabled = False
Else
With Rst
.Bookmark = Me.Bookmark
Me!LblRecNum.Caption = Me.CurrentRecord & " of " & .RecordCount
End With
End If
Rst.Close
Set Rst = Nothing
End Sub
Private Sub IntervalID_AfterUpdate()
Me!NextRec.Enabled = True
Me!NewRec.Enabled = True
End Sub
Private Sub SfrmClientResponse_Enter()
If IsNull(Forms!FrmClient!SfrmSurvey!SurveyID) Then
MsgBox "You Must Enter The Interval First!", , "What Is The Interval?"
Forms!FrmClient!SfrmSurvey!IntervalID.SetFocus
End If
End Sub
Private Sub SfrmSurveyContact_Enter()
If IsNull(Forms!FrmClient!SfrmSurvey!SurveyID) Then
MsgBox "You Must Enter The Interval First!", , "What Is The Interval?"
Forms!FrmClient!SfrmSurvey!IntervalID.SetFocus
End If
End Sub
Private Sub NextRec_Click()
DoCmd.GoToRecord , , acNext
End Sub
Private Sub PrevRec_Click()
DoCmd.GoToRecord , , acPrevious
Me!NewRec.Enabled = True
End Sub
Private Sub NewRec_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Below is the current code I have in my database, thanks to some help from PC
Datasheet! Question I have is two fold, I have a checkbox called
SuccessfulContact, how and where would I put an event to 1. make the
SfrmClientResponse not visible unless the value of SuccessfulContact Check
box is true(IsNotNull) Second I would like to lock the combobox IntervalID
until SuccessfulContact is made (same checkbox) I have a main form
FrmClient with 2 subforms Sfrm Survey and Sfrm ClientResponse. All help
would be greatly appreciated. TIA Suzanne Wyatt
Private Sub Form_Current()
Me!ProgramCategoryID.Requery
Me!ProgramCategoryID.SetFocus
End Sub
Private Sub ProgramCategoryID_AfterUpdate()
Me!ProgramID.Requery
End Sub
Private Sub FindClientNum_Enter()
Me!FindClientNum.Dropdown
End Sub
Private Sub FindClientNum_AfterUpdate()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ClientID] = " & Me!FindClientNum
Me.Bookmark = Rst.Bookmark
Rst.Close
Me!FindClientNum = Null
Me!SfrmSurvey.SetFocus
Me!SfrmSurvey!IntervalID.SetFocus
End Sub
Private Sub FindClientLastName_Enter()
Me!FindClientLastName.Dropdown
End Sub
Private Sub FindClientLastName_AfterUpdate()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[ClientID] = " & Me!FindClientLastName
Me.Bookmark = Rst.Bookmark
Rst.Close
Me!FindClientLastName = Null
Me!SfrmSurvey.SetFocus
Me!SfrmSurvey!IntervalID.SetFocus
End Sub
Option Compare Database
Private Sub cbxSurveyResponse_AfterUpdate()
Me!SurveyResponseID = Me!cbxSurveyResponse
Me!cbxSurveyResponse = Null
Me!SurveyID = Forms!FrmClient!SfrmSurvey!SurveyID
End Sub
Private Sub Form_Current()
Me!cbxSurveyResponse.Requery
End Sub
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim Rst As Recordset
Set Rst = Me.RecordsetClone
If Rst.RecordCount <> 0 Then
Rst.MoveLast
End If
' deactivate the previous button when on the first record
Me!PrevRec.Enabled = (Me.CurrentRecord <> 1)
' deactivate the next button when on the last record
Me!NextRec.Enabled = (Me.CurrentRecord < Rst.RecordCount)
If Me.NewRecord Then
Me!LblRecNum.Caption = "New"
Me!NewRec.Enabled = False
Else
With Rst
.Bookmark = Me.Bookmark
Me!LblRecNum.Caption = Me.CurrentRecord & " of " & .RecordCount
End With
End If
Rst.Close
Set Rst = Nothing
End Sub
Private Sub IntervalID_AfterUpdate()
Me!NextRec.Enabled = True
Me!NewRec.Enabled = True
End Sub
Private Sub SfrmClientResponse_Enter()
If IsNull(Forms!FrmClient!SfrmSurvey!SurveyID) Then
MsgBox "You Must Enter The Interval First!", , "What Is The Interval?"
Forms!FrmClient!SfrmSurvey!IntervalID.SetFocus
End If
End Sub
Private Sub SfrmSurveyContact_Enter()
If IsNull(Forms!FrmClient!SfrmSurvey!SurveyID) Then
MsgBox "You Must Enter The Interval First!", , "What Is The Interval?"
Forms!FrmClient!SfrmSurvey!IntervalID.SetFocus
End If
End Sub
Private Sub NextRec_Click()
DoCmd.GoToRecord , , acNext
End Sub
Private Sub PrevRec_Click()
DoCmd.GoToRecord , , acPrevious
Me!NewRec.Enabled = True
End Sub
Private Sub NewRec_Click()
DoCmd.GoToRecord , , acNewRec
End Sub