Pop Up Form --maybe??

Don Marshall

New member
Local time
Today, 21:22
Joined
Jun 4, 2001
Messages
7
I'm not even sure if this is the correct term. I have a "main" form that captures case information. I want to add a field that is tied to a table of zip codes. When the user types in the zip code, a form would "pop up" with the City, State, Area Code, and a number of vendors in that area. The user could then chose the vendor and either cut/paste or just close the pop up and enter the vendor into the vendor field on the main form. Does this make work?
Don
 
This event would need to be set on the field [ZipCode] AfterEvent property. To make it work properly you would need to find records in a table or query that joins the City, Vendor, etc by Zip Code and reference your pop up form to call up records that equal [ZipCode] on your main form.
 
I tried that process on a test form and, sure enough, a form showed up behind my "main form." 1) How do I make it pop up on top and 2) the form that popped up was on record #1... not the one I had entered. By the way, the table with the zipcodes has all of the vendor information within the same record row as the needed/used zipcode. I hope this makes sense!
 
This worked when I tried it, you will need to adjust it a little.

DoCmd.OpenForm "frmSecondForm", acNormal, , "[ZipCode] = " & Me.ZipCode, acFormReadOnly, acWindowNormal, PopUp = True

HTH

PS Try acFormDS in place of acNormal if you want a datasheet view.

[This message has been edited by jwindon (edited 10-10-2001).]
 
Jon,
Sorry for the delay, I was out of the office. Now my real ignorance comes out... the commands you provided... do they go into "code builder" or a macro. I could not find anything other than OpenForm on the macro so, I'm guessing code-builder (and, needless to say, this will be uncharted territory but I always like the challange.
Thanks, Don
 
Jon,
One more thing... your AfterEvent - confirm this is the same as AfterUpdate??
 
Jon,
Okay, I think I may be closer. I have figured out it is Visual Basic and I have built the macro. However, I am having problems at the Me. area. I have tried putting the table name here (zipcodetest), the field (Zip) and the form secondary form name (zipcodefields) but an error message: "Compile Error. Method or Data Member not Found." I can't help but think I'm close.
Don
 
Yes, put the Code on the AfterUpdate, or on a command button, whatever suits you. Right click on the control or command button in form design view, hit properites, goto the events tab and find AfterUpdate or OnClick (for command button). Now, I'm sorry I've been away from this part of the forum for a while. Now, lets see what's up...

DoCmd.OpenForm "zipcodefields", acNormal, , "[Zip] = " & Me.Zip, acFormDS, acWindowNormal, PopUp = True


I'm wondering though, you said "tables". You should be opening a FORM from another form. What are the names of your main form and the form that would show the zipcodes if you opened it straight from the database window?

[This message has been edited by jwindon (edited 10-12-2001).]
 
Here is what I'm working with (again, this is a test form... I want to get it right before I write the code in my regular data base).
Tables: maintest (a table where I want the zipcode field to open the popup box with the other data from that table.
zipcodetest (a table with the zip code information - currently with city, state,area code and timezone -- soon to have vendors if I get it working.

Forms: maintest (the "main" form that contains a combo box tied to the zipcodetest table (this could be a problem??)
zipcodefields (a form with the data from zipcodetest table.

So, what I want to do is enter a zip code (currently a combo box) that will popup the form with the various pieces of data from the line in the zipcodetest table. That way, I can design a form that, after the zip is entered and they tab out (AfterUpdate) a form opens showing the vendors for that ZIP.

Don Marshall
 

Users who are viewing this thread

Back
Top Bottom