Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass info to next form 3

Status
Not open for further replies.

jwm

Technical User
Jul 29, 2001
10
US
I have a form on which the user can lookup a specific member using a combo box. Due to many members having the same name, I want the user to ensure they have the correct member before proceeding. Once they've confirmed the member, I want them to choose among three forms, via a command button, carrying the ID of the member forward to the selected form. The below code works as a filter if in edit mode, however when I open the form as a new record it does not insert the ID into the field. It will open the form, focus on the appropriate field, but enter nothing.

Any help is appreciated as I'm obviously overlooking something. TIA!


Private Sub Cash_Donation_Click()

Dim strForm As String, strWhere As String

strForm = "frmMembersPayments"
strWhere = "lngMemberID = """ & Me!lngMemberID & """"
DoCmd.OpenForm FormName:=strForm, wherecondition:=strWhere, Datamode:=acFormAdd

End Sub
 
JWM,
The way I do it is simple. On the load event of the form I am going to, I use this.
Code:
txtMyCarryOverName = [forms]![frmOriginal].[cboName]
Hope this helps
Scott ::)
 
Thanks, Scoty.

However, I'm still missing the forest for the trees. I tried your method and it simply opened the form with nothing entered in the "memberID" field. The form opens with focus to the "memberID" field, but nothing entered in the field. I can manually enter a number, or select it off the combo box, but when entering the form from the feeder form, the number does not transfer.

Although I know it's a simple issue, I can't seem to get anything to work. LOL

TIA.
 
Set the default value of the form being opened to look at the other form:

[Forms]![frmOriginal]![cboName]
Joe Miller
joe.miller@flotech.net
 
Joe:

Thanks!

Now that seems to work, but was too simple...there must be a downside! LOL

John
 
No downside, sorry..
Joe Miller
joe.miller@flotech.net
 
Joe:

That was a nifty trick, "too obvious," and totally suited to my needs.

Thanks very much!

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top