C
Chaster
With a combobox I want to search for a companies address and if found go to
that record by using the [CompanyId] field.
I have that working ok.
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CompanyID] = " & Str(Me![Combo35])
Me.Bookmark = rs.Bookmark
Me.Rest.SetFocus
If the data is not found I want to enter a new record and insert the data
that was just typed into the combox into the [BusinessStreet] field in the
new record and set the focus to another control.
I have tried this on the after update of the not in list property but it is
not working.
Basically it would be something like
If (the data I just typed is found) then
find and display the record based on the CompanyID
Else
enter new record (CompanyId) is autonumber
[BusinessStreet] = (whatever I just typed that was not found)
me.Company.setfocus
end if
Any help would be appreciated.
that record by using the [CompanyId] field.
I have that working ok.
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CompanyID] = " & Str(Me![Combo35])
Me.Bookmark = rs.Bookmark
Me.Rest.SetFocus
If the data is not found I want to enter a new record and insert the data
that was just typed into the combox into the [BusinessStreet] field in the
new record and set the focus to another control.
I have tried this on the after update of the not in list property but it is
not working.
Basically it would be something like
If (the data I just typed is found) then
find and display the record based on the CompanyID
Else
enter new record (CompanyId) is autonumber
[BusinessStreet] = (whatever I just typed that was not found)
me.Company.setfocus
end if
Any help would be appreciated.