J
Jason
I am new at playing around with forms and hope someone can help me with the
following issue.
I am trying to get a form to autocomplete all fields by record number by 2
different searchable fields.
I have two fields (1) SearchCode (2) SearchName.
When I type in a client code in the SearchCode field I have the AfterUpdate
select that record number and fill in
- name
- address
- suburb etc.
I then tried to add the same situation for the SearchName field. It seems
to just ignore what i type in this field and wont auto complete all the
address fields etc.
This is what i have for both fields:
Private Sub SearchCode_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CUSTNMBR] = '" & Me![SearchCode] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Search_AfterUpdate()
Me.SearchCode.Value = ""
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CUSTNAME] = '" & Me![Search] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Any help would be much appreaciated and I hope it makes sense.
following issue.
I am trying to get a form to autocomplete all fields by record number by 2
different searchable fields.
I have two fields (1) SearchCode (2) SearchName.
When I type in a client code in the SearchCode field I have the AfterUpdate
select that record number and fill in
- name
- address
- suburb etc.
I then tried to add the same situation for the SearchName field. It seems
to just ignore what i type in this field and wont auto complete all the
address fields etc.
This is what i have for both fields:
Private Sub SearchCode_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CUSTNMBR] = '" & Me![SearchCode] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Search_AfterUpdate()
Me.SearchCode.Value = ""
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CUSTNAME] = '" & Me![Search] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Any help would be much appreaciated and I hope it makes sense.