C
cmco
I have a form frmJobs which contains a subform sfrmCustomers. frmJobs has a
combo box whose sourse is the JobName field in tblJobs. The subform has a
combo bo whose sourse is the CustName field in tblCustomers. When a job is
selected in cboJobName the related customer information is displayed in the
sfrmCustomers. The two tables are related via a common CustomerID field in
both tables.
Two questions: cboJobeName did not show the new record in tblJobs so I hd to
add a NewRecord cmdButton to create a blank record for selection in the combo
box. Is there a way to have the new blank record automatically displayed in
the combo box each time a record is added; preferrably at the beginning of
the dropdown list rather than at the bottom? This is also the same problem
with the cboCustomers dropdown list.
Second Problem; When a new record is added in the Jobs form and I then
select a customer(existing) from the subforms cboCustomers the Main Jobs form
changes to the first Job with that customer. How do I get the Jobs form to
stay on the new Jobs record? I am using the FindFirst function in the
after_update event of cboCustomers as follows. I suspect that there is a more
correct approach.
Private Sub cboCustomerID_AfterUpdate()
Dim srs As Recordset, Criteria As String
Set srs = Me.RecordsetClone
Criteria = "[CustomerID] = " & Me.cboCustomerID
srs.FindFirst Criteria
If Not srs.NoMatch = True Then
Me.Bookmark = srs.Bookmark
End If
End Sub
Would someone help this obvious novice?
combo box whose sourse is the JobName field in tblJobs. The subform has a
combo bo whose sourse is the CustName field in tblCustomers. When a job is
selected in cboJobName the related customer information is displayed in the
sfrmCustomers. The two tables are related via a common CustomerID field in
both tables.
Two questions: cboJobeName did not show the new record in tblJobs so I hd to
add a NewRecord cmdButton to create a blank record for selection in the combo
box. Is there a way to have the new blank record automatically displayed in
the combo box each time a record is added; preferrably at the beginning of
the dropdown list rather than at the bottom? This is also the same problem
with the cboCustomers dropdown list.
Second Problem; When a new record is added in the Jobs form and I then
select a customer(existing) from the subforms cboCustomers the Main Jobs form
changes to the first Job with that customer. How do I get the Jobs form to
stay on the new Jobs record? I am using the FindFirst function in the
after_update event of cboCustomers as follows. I suspect that there is a more
correct approach.
Private Sub cboCustomerID_AfterUpdate()
Dim srs As Recordset, Criteria As String
Set srs = Me.RecordsetClone
Criteria = "[CustomerID] = " & Me.cboCustomerID
srs.FindFirst Criteria
If Not srs.NoMatch = True Then
Me.Bookmark = srs.Bookmark
End If
End Sub
Would someone help this obvious novice?