hunterfan48
Registered User.
- Local time
- Today, 00:39
- Joined
- Aug 17, 2008
- Messages
- 436
Hi guys,
I'm working on the Boutique Fudge database from the Missing Manual: Access 2007 book. In chapter 17, they are teaching me how to have code in the 'on not in list' event to have another form popup that allows me to enter info in it.
I understand the code that gets me to open the other form. However, I'm confused as to pulling in the name I just typed in the combo box to having that pull in to this new popup form.
Here's the code I'm looking at.
I think I'm getting mixed up in the DLookup section.
What's this part all about?
ProductName='" & NewData & "'")
Maybe if I can figure that out...the rest will come to me.
Thanks,
Brady
I'm working on the Boutique Fudge database from the Missing Manual: Access 2007 book. In chapter 17, they are teaching me how to have code in the 'on not in list' event to have another form popup that allows me to enter info in it.
I understand the code that gets me to open the other form. However, I'm confused as to pulling in the name I just typed in the combo box to having that pull in to this new popup form.
Here's the code I'm looking at.
Code:
' Open the AddProduct form, with three additional arguments.
DoCmd.OpenForm "AddProduct", , , , , acDialog, NewData
' Cancel the edit. That's because you need to refresh the list
' before you can select the new product.
ProductID.Undo
' Refresh the list.
ProductID.Requery
' Now find the ProductID for the newly added item using DLookup.
ProductID = DLookup("ID", "Products", "ProductName='" & NewData & "'")
' Refresh the price.
ProductID_Change
End Sub
I think I'm getting mixed up in the DLookup section.
What's this part all about?
ProductName='" & NewData & "'")
Maybe if I can figure that out...the rest will come to me.
Thanks,
Brady