Pop-Up Forms Linked to Original Table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Gang,

I tried looking through all the other postings & couldn't find a solution.
I hope this is pretty trivial...

I want to have a pop-up form gather more information about a particular
record. I don't want to add another tab in the form itself, nor do I want to
create a sub-form. Instead, I want a pop-up window to appear so the user can
input more information about that particular record.

I created a button called "More..." to handle this. The button is clicked
to store more information about the record (self-explanatory). This button
is tied to a macro that opens up the new form to gather additional
information. When I input data into this new form, save it, and then
close... it doesn't store the data for the master record I was in.

Ex: Say my database has 3 master records. When I'm on record #2, I hit this
"More" button, the pop-up window comes up, I save the record and close the
pop-up window. However, now when I go to Master record #1, and hit the
"More" button again, the data I just entered when I was in master record #2
comes up. It should be blank because I'm now in Master Record #1.

In short, I want the pop-up window to store the record I was currently in on
the Master Form. I created a SAVE button on the pop-up window to save the
information for that current record. Btw, all this information for the
pop-up form is stored on a separate table and the relationship is linked
successfully.

I tried the "Where" function, but I'm not so familiar with it.

Any help is greatly appreciated.

Happy holidays.

Frank
 
OK Lets look at how to open this form. I don't know how to do it with a
macro (I only write VBA code) but it's only a line so I'm sure you'll get it
figured out.

The first thing you need to do is open your popup form in design view, and
open the form's property sheet. Find the textbox housing the ID field and
set its DefaultValue property (on the Data tab of the property sheet) to:

= Forms!MainFormName!txtID

where txtID is the name of the ID field text box.

Now code your "More..." button's click event:

Sub cmdMore_Click()
DoCmd.OpenForm "My Popup Form",,,"ID =" & Me.txtID
End Sub

Opening a popup with no record will create one which has the same ID as the
main form. If there is an existing record, it will open to it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Arvin,

That worked perfectly! Thanks.

Frank

Arvin Meyer said:
OK Lets look at how to open this form. I don't know how to do it with a
macro (I only write VBA code) but it's only a line so I'm sure you'll get it
figured out.

The first thing you need to do is open your popup form in design view, and
open the form's property sheet. Find the textbox housing the ID field and
set its DefaultValue property (on the Data tab of the property sheet) to:

= Forms!MainFormName!txtID

where txtID is the name of the ID field text box.

Now code your "More..." button's click event:

Sub cmdMore_Click()
DoCmd.OpenForm "My Popup Form",,,"ID =" & Me.txtID
End Sub

Opening a popup with no record will create one which has the same ID as the
main form. If there is an existing record, it will open to it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top