Pop Up Form Question

  • Thread starter Thread starter Brigham Siton
  • Start date Start date
B

Brigham Siton

Using Access 97, we have two forms. One is the record entry form and the
other is a Pop Up form.

Here is what we are trying to accomplish:

On the entry form, there is a control called Tax_ID_Num. After entering
a tax-id in this control, that there will be a
pop-up form based on a query that selects everything with matching tax id.

Out of that list the user will then select the one out of the list (with a
checkbox or
something), close the pop up form, then dump the selected record on the
entry form.

Can somebody advise me or show me examples on how to do this?

Thank you very much in advance.
 
1. If you are storing the results of the initially
selected item in a listbox you can pass the column values
to public variables stored in modules that the main form
can find and use.


create a module

in that module declare your global variables
after the option explicit

Public variablex, y, z, a as string

on the popup form, if you are storing this information in
alist box

control source for listbox
select field1, field2, field3, field4 from table where
criteria is met.

on the click event for the list box

variablex= me.listbox.column(0).value
y = me.listbox.column(1).value
z = me.listbox.column(2).value
z = me.listbox.column(3).value

Then on your main form, when you do the insert you can
call the global variables

Insert into table1 values(variablex, y,z,a,me.field1,
me.field2);

This should work
 
Brigham,
Don't use 2 forms!!!

All you need is the one entry form.
Add a Combo Box to the Form Header area.
Use the Combo Wizard to create the box.
Select the 3rd option on the first page of questions,
something like "Find a record ..." etc.
When the wizard asks what fields to include, add the record's
Prime Key field, the Tax_Id_Num field, and whatever other
fields are needed to identify the record you would otherwise
click on that check box for (the one you wanted on the second form).
Hide the record Prime Key field.
Finish with the wizard.

Then open the Combo Box property sheet.
Click on the RowSource property line, then on the
button with the 3 dots that will appear.
When the RowSource grid appears, set the
Tax_Id_Num Sort to Ascending.
Save the change.

Then set the Combo Box AutoExpand property to Yes.
Size the combo box column widths to properly display all the fields,
except the first one, (the bound RecordID column). That should be 0".

When you run the form click on the combo box.
Enter the Tax_Id_Num you want.
If there are more than one record with the same Tax_Id_Num,
they will be listed one under the other. Use the other fields to help
identify
the specific record you want. Select that record.
The form will fill with that records data.
 
Back
Top