R
Ray C
I have a situation where I want to display information that is held in two
different Tables in one Form. The Main Form has a record source linked to the
Customer Table and my Embeded Sub Form has a Query as it's data source and
the query is linked to the Stock Table (and a number of others). Both these
tables are linked by a Contract number. If the equipment is in stock, the
contract number will be "0" if it is booked out to a customer, it will have a
Contract Number recorded in the Table and the Customer will have the same
contract number held in the Customer Table.
Here is what I am trying to achieve.
I want to input the serial number of a piece of equipment and search for
that in the Stock Table (via the Form that is embeded in my Main Form that is
based on a Query of the Stock Table). If the equipment is found and it is
linked to a Contract Number, I want to display the Customer Details in the
Main Form that is Based on the Customer Table.
The code is
Dim strForm As Form
With strForm.RecordsetClone
.FindFirst strCriteria
If Not .NoMatch Then
strForm.Bookmark = .Bookmark
util_Populate = True
Else
util_Populate = False
End If
End With
This works fine when the Embedded Form is based on the Stock Table but does
not work when I change my Embeded Form to be based on a Query. The routine
still finds the item and returns True but the Embeded Form does not display
the correct record. (as though the Bookark has been placed in the wrong place)
Any help appreciated RayC
different Tables in one Form. The Main Form has a record source linked to the
Customer Table and my Embeded Sub Form has a Query as it's data source and
the query is linked to the Stock Table (and a number of others). Both these
tables are linked by a Contract number. If the equipment is in stock, the
contract number will be "0" if it is booked out to a customer, it will have a
Contract Number recorded in the Table and the Customer will have the same
contract number held in the Customer Table.
Here is what I am trying to achieve.
I want to input the serial number of a piece of equipment and search for
that in the Stock Table (via the Form that is embeded in my Main Form that is
based on a Query of the Stock Table). If the equipment is found and it is
linked to a Contract Number, I want to display the Customer Details in the
Main Form that is Based on the Customer Table.
The code is
Dim strForm As Form
With strForm.RecordsetClone
.FindFirst strCriteria
If Not .NoMatch Then
strForm.Bookmark = .Bookmark
util_Populate = True
Else
util_Populate = False
End If
End With
This works fine when the Embedded Form is based on the Stock Table but does
not work when I change my Embeded Form to be based on a Query. The routine
still finds the item and returns True but the Embeded Form does not display
the correct record. (as though the Bookark has been placed in the wrong place)
Any help appreciated RayC