Option Compare Database
'This function will run when the "All" button is clicked.
Private Sub DisplayAll_Click()
Form_CustomerList.RecordSource = "select CustomerList.TGAcctNo, CustomerList.FieldworkStartDate, CustomerList.FieldworkEndDate , SurveyInfo.* from CustomerList inner join SurveyInfo on SurveyInfo.SurveyID = CustomerList.SurveyID"
End Sub
'This function will run when the "Search" button is clicked.
Private Sub DisplaySearch_Click()
'Check text field
If Len(AcctSearch) = 0 Or IsNull(AcctSearch) Or Len(AcctSearch) < 10 = True Then
MsgBox "Please a valid TG Account No."
Else
'Update query
Form_CustomerList.RecordSource = "select CustomerList.TGAcctNo, CustomerList.FieldworkStartDate, CustomerList.FieldworkEndDate , SurveyInfo.* from CustomerList inner join SurveyInfo on SurveyInfo.SurveyID = CustomerList.SurveyID where CustomerList.TGAcctNo like '" & AcctSearch & "'"
MsgBox Form_CustomerList.RecordsetClone.RecordCount & " Record(s) found."
End If
End Sub
'This function will run when the form is first opened.
Private Sub Form_Open(Cancel As Integer)
Form_CustomerList.RecordSource = ""
'Form_CustomerList.RecordSource = "select CustomerList.TGAcctNo, CustomerList.FieldworkStartDate, CustomerList.FieldworkEndDate , SurveyInfo.* from CustomerList inner join SurveyInfo on SurveyInfo.SurveyID = CustomerList.SurveyID"
End Sub
Hornet Models - 1/35 scale Commonwealth Soldier
3 weeks ago
No comments:
Post a Comment