On Sun, 08 Feb 2004 16:10:47 GMT, news.bellatlantic.net wrote:
I have a fundraising database for an organization. Donations come in from
current members anad are found by using a combo box. If the member is found,
the After Update macro switches to another form where the donation is
entered.
The problem is that if the donor is not a member, the On Not in List macro
won't work for me bringing up a form with a new member number and all the
fields that have to be filled out.
I guess that the After Update property and On Not In List property conflict.
Any workaround?
Thanks in advance.
Here is one method to open a form.
Code the Combo's NotInList event like this:
MsgBox "Double-click this field to add an entry to the list.", , "Not
In List"
Response = acDataErrContinue
====
Next code the combo's Double-click event:
' Note: Change MemberID to whatever the actual name
' of your Combo Box is. Change "frmMembership" to whatever the actual
form name is.
On Error GoTo Err_MemberID_DblClick
Dim lngMemberID As Long
If IsNull(Me![MemberID]) Then
Me![MemberID].Text = ""
Else
lngMemberID = Me![MemberID]
Me![MemberID] = Null
End If
DoCmd.OpenForm "frmMembership", , , , , acDialog, "GoToNew"
Me![MemberID].Requery
If lngMemberID <> 0 Then Me![MemberID] = lngMemberID
Exit_MemberID_DblClick:
Exit Sub
Err_MemberID_DblClick:
MsgBox "Error #: " & Err.Number & " " & Err.Description, ,
Me.Name
Resume Exit_MemberID_DblClick
====
Then code the frmMembership Load event:
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![MemberID]) Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
====
When you enter a name into the combo box that is not in the list, a
message will appear to double-click the control if the user wishes to
add the name. Double-clicking the Combo Box will open the
frmMembership form to a new record for data entry.
Close the form when done, and the new name will appear in the combo
box.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.