Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value from first form opened in second

Status
Not open for further replies.

bill1one

Programmer
Sep 29, 2004
93
US
I have two forms, one simple form (frmNewTitle) where information is entered and another form that displays information (frmPeriodical).

When data is entered into txtISSN in frmNewTitle and the user clicks save, I want the new record that corresponds with txtISSN value to appear in frmPeriodical.

I've tried a simple OnClose event that looks like this:
Forms!frmPeriodical.ISSN.Requiry

But the object doesn't support that method.

Any suggestions?
 
You can use .requery to repopulate a combo or list box, or the form. But a text field?

Is the field txtISSN or ISSN?
txtISSN
Forms!frmPeriodical.ISSN.Requiry

Are you trying to display the results in the text field?
Or find a matching record for ISSN number?

Richard
 
I tested the following code with a test database -- worked just fine. you would have to change the field names to match.

Code:
Private Sub cmdUpDateTrans_Click()

If Nz(Forms!TransactionFrm.MemberID, 0) Then
    Forms!TransactionFrm.MemberID.Requery
End If

End Sub

Me.cmdUpDateTrans_Click
Is a command button I added to the Membership form. A member is added, and then the command button is used to run the code.

Forms!TransactionFrm.MemberID
Was a text field that was changed to a combo box on the transaction form.

After creating a new member in the Membership form, I clicked the command button an then varified the combo box in the transaction form was repopulated with the new record.

If you are getting an error, then I would suggest you verify the names of the object on the form match the code.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top