Hello,
I have read about 2 dozen posts on this and it appears simple. Yet my code fails every time.
I have 2 tables with data. I have a form with multiple tab pages.
The controls on the first tab page all come from the first table.
I have a drop down "Choose or Enter Business Name" which lists the business names in the first table.
I want to populate the rest of the form based on the business name chosen.
My code:
Private Sub BusinessName_AfterUpdate()
Dim rst As DAO.Recordset
Dim strSearchName As String
Set rst = Me.Recordset
strSearchName = (Me!BusinessName)
rst.FindFirst "[Business Name] = " & strSearchName
If rst.NoMatch Then
MsgBox "New Business?"
End If
rst.Close
End Sub
Could someone please tell me what Im doing wrong? This is straight from a microsoft example.
Thankyou.
I have read about 2 dozen posts on this and it appears simple. Yet my code fails every time.
I have 2 tables with data. I have a form with multiple tab pages.
The controls on the first tab page all come from the first table.
I have a drop down "Choose or Enter Business Name" which lists the business names in the first table.
I want to populate the rest of the form based on the business name chosen.
My code:
Private Sub BusinessName_AfterUpdate()
Dim rst As DAO.Recordset
Dim strSearchName As String
Set rst = Me.Recordset
strSearchName = (Me!BusinessName)
rst.FindFirst "[Business Name] = " & strSearchName
If rst.NoMatch Then
MsgBox "New Business?"
End If
rst.Close
End Sub
Could someone please tell me what Im doing wrong? This is straight from a microsoft example.
Thankyou.