filling in forms fields based on contents of other forms

  • Thread starter DowningDevelopments
  • Start date
D

DowningDevelopments

I have a main form called receipts that has a dropdown list that lists
methods of payments which when clicked on open up the appropriate form, so
clicking on cash will open the cash form.

That works great, what doenst work is that when the form opens i want a way
to associate the new form with the parent, do i do this using subform??
Seeing as i have 5 payment methods i choose against this and decided to have
forms that simply import in the receiptNumber (an autonumber) from the
receipt form, the ReceiptNumber is the foreign key in the Cash, CreditCard,
Debit and Cheque tables.
These forms are data entry.

My exact problem is that when the forms load i want them to look up this
ReceiptNumber as long as the receipts form is open hence i am using this
code, which seems to be working on some forms but not on others, ive spent
the whole morning looking at this and tyring to synch all the forms tothe
working one but its just temrapental about what it works with and what it
doesnt.

Private Sub Form_Load()
If CurrentProject.AllForms(Receipts).IsLoaded = True Then
Me![ReceiptNo] = Forms![Receipts]![RecieptNumber]
Else
Me![ReceiptNo] = "1"
End If
End Sub

Is there a better way to do this or can i salvage this method?

With much thanks

Amit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top