adding new record from a form

colkas

Registered User.
Local time
Today, 04:15
Joined
Apr 12, 2011
Messages
128
Hi

I ahve a form with 2 combo boxes related to each other

Client and Site (1 client can have many sites).

In the client combo box I have Notinlist working well and if it is not in the list my message box activates the subclientform where I can add in the new details and also sites at the same time.

I am now having trouble with the Site field. If the client exists but the site does not then I want to simply go through to the subclientform (where site is a subform), add the new site and then go back to quote. The wizard button I have works fine, until I go back to the quote and then the new site does not display in the drop down list until I close the quote form and go back in to the form again...... I dont want to make it as complex as the Notinlist, so any ideas please........

Private Sub Command106_Click()
On Error GoTo Err_Command106_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SubFormClient"

stLinkCriteria = "[ClientID]=" & Me![cboQclientid]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command106_Click:
Exit Sub
Err_Command106_Click:
MsgBox Err.Description
Resume Exit_Command106_Click

End Sub
 
Hi Colkas
Are you requerying the subform after you add the new record?
 
Hi

Yes I am, in two places (I have one on the combo using notinlist) and I also have added a re-query into the combo box relevant to my problem now but this does not work.

Thanks
 

Users who are viewing this thread

Back
Top Bottom