Steven Deetz
Registered User.
- Local time
- Today, 15:58
- Joined
- Jul 19, 2001
- Messages
- 49
In several database wizards, Microsoft includes a neat feature when a user double clicks on a combo box a form will open up to add a new field of data to the list the combo box is tied to.
As a donation, I am re-writing a Bowl-for-Kids Sake program for the local Big Brothers Big Sisters chapter. Bowlers go out and collect Sponsors. Each bowler can have many sponsors and each sponsor can have many bowlers.
When I try the rebuild the Microsoft example code for the combo box's Dbl Click property, the form to add a new sponsor opens up but will not go to the new record. Anyone have any ideas why the "GoToNew" in the OpenArgs does not want to work? Thanks!
Private Sub cboSponsorLookup_DblClick(Cancel As Integer)
On Error GoTo Err_cboSponsorLookup_DblClick
Dim intSponsorID As Long
If IsNull(Me![cboSponsorLookup]) Then
Me![cboSponsorLookup].Text = ""
Else
intSponsorID = Me![cboSponsorLookup]
Me![cboSponsorLookup] = Null
End If
DoCmd.OpenForm "Sponsors", , , , , acDialog, "GoToNew"
Me![cboSponsorLookup].Requery
If intSponsorID <> 0 Then Me![cboSponsorLookup] = intSponsorID
Exit_cboSponsorLookup_DblClick:
Exit Sub
Err_cboSponsorLookup_DblClick:
MsgBox Err.Description
Resume Exit_cboSponsorLookup_DblClick
End Sub
As a donation, I am re-writing a Bowl-for-Kids Sake program for the local Big Brothers Big Sisters chapter. Bowlers go out and collect Sponsors. Each bowler can have many sponsors and each sponsor can have many bowlers.
When I try the rebuild the Microsoft example code for the combo box's Dbl Click property, the form to add a new sponsor opens up but will not go to the new record. Anyone have any ideas why the "GoToNew" in the OpenArgs does not want to work? Thanks!
Private Sub cboSponsorLookup_DblClick(Cancel As Integer)
On Error GoTo Err_cboSponsorLookup_DblClick
Dim intSponsorID As Long
If IsNull(Me![cboSponsorLookup]) Then
Me![cboSponsorLookup].Text = ""
Else
intSponsorID = Me![cboSponsorLookup]
Me![cboSponsorLookup] = Null
End If
DoCmd.OpenForm "Sponsors", , , , , acDialog, "GoToNew"
Me![cboSponsorLookup].Requery
If intSponsorID <> 0 Then Me![cboSponsorLookup] = intSponsorID
Exit_cboSponsorLookup_DblClick:
Exit Sub
Err_cboSponsorLookup_DblClick:
MsgBox Err.Description
Resume Exit_cboSponsorLookup_DblClick
End Sub