Working with forms and controls

DougW

New member
Local time
Today, 17:42
Joined
Mar 5, 2002
Messages
6
I'll try to be as brief as possible.

I have a form "CustomerInfo" which includes the customers phone number. I have a button on this form called "Sell". When the "Sell" button is clicked on I want to capture the phone number from this form, save the current record, and close the form. Then, open another form "SoldInfo" which will create a new record. The Phone number will be placed in the new SoldInfo record allowing me to link the two(CustomerInfo and SoldInfo) tables for later use.

My problem is I can't seem to get off the ground. How do you define a form control or set up code to recognize a form and form controls? If someone can just get me pointed in the right direction I would appreciate it very much. If, in your reply, you plan on using "Me" as part of the solution..... I'll need help with that also.

Thanks,
Doug W.
 
I'm not sure if this is the best way but it's the way i'd do it.

1)Create an append query Where you are appending the Phone number from the CustomerInfo Table to the SoldInfo Table and in the criteria add the following [Forms]![CustomerInfo]![PhoneNumber] This will appended the phone number of what ever record you have open to the Sold Info Table.

2)Now for the code behind the sell button, right click on it select properties then Event, now select on click and click on the little button with the 3 dots on it and select code builder and enter the following code

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenQuery "The Name of your append query", acViewNormal, acEdit

that will do exactly what you require, need any more explanation let me know

Geoff
 
Geoff, Thanks for the input. What I finally did, after attending about 2 days in "flounder" school was assign the phone nr. to a variable from the customer Info from. Then opened the SoldInfo form and inserted the number in the phone field of that form. The reason I did this is because I am going to have to manipulate the record set with code anyway. So now all I have to do is fill in the sold info form with quanity, description and price and update or cancel whichever may be the case. Well, there's really quite a bit more going on but that covers the basic function of the form anyway.

Thanks again...very much for the input.

Doug W.
 

Users who are viewing this thread

Back
Top Bottom