Unanswered: Creating First Form - Help with Look Up
I work with queries all day long and am trying my hand at creating a form. It isn't going too well!
General pusrpose: My company mails advertisements, when a person calls in, we'd like to be able to have them give us their "reference number" and pull their info up from the table we used to mail.
So... I have 1 table of people that I have mailed, complete with a Primary Key ("ref #") and about 30 other fields. I would like to have the form allow us to search by ref #, then populate the information in the other fields for that record. I will only want about 10 of the 30 fields visible. And I don't want the person to be able to edit the data at all. Once it pulls up the record I would like to append that record into a new table, along with the current date/time.
I added some unbound lookup boxes but can't find a button that will display my values. I don't know VisualBasic. How can I get to the next step where the record appears? There's more that I'd like to do but this first part seems like it should be so simple and I can't figure it out on my own.
Set the AllowEdits, AllowDelete and AllowAdditions properties for the form to No to make the form read-only.
Place a command button on the form to use as a trigger for finding (the code below refers to this button as cmdFindByRef.
Use a VBA subprocedure to filter by the Ref #... eg
Private Sub cmdFindByRef_Click()
Dim intFindWhat As Integer
intFindWhat = InputBox("What reference number do you want to find?", "Find by Ref #")
Me.Filter = "[Ref #] = " & intFindWhat
Me.FilterOn = True
This code is a bit "rough and ready" and it assumes your ref # is an integer but it should send you in the right direction at least.
Ok. When using that code, how do I specify that the "ref #" they entered is coming from that column? I don't see where I'm doing that. What is it actaully filtering?
You know, I'm thinking I need to read a book on it before i can complete what I thought was going to be a simple task. I can usually work things out using help, I don't think that's going to be the case here. Any thoughts on that? Or suggested reading material?