Open New Record in Form B with Data from Form A

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

Guest

I have a form A where I choose the associate name and date, and then I feed
that information in a OpenForm command in VB as the where condition to open
the desired record.

I have form B set up to accept a new entry, so if there is a record matching
the criteria, it will display, and if there is no record matching the
criteria, it will display a blank record.

What I'd like to be able to do is if there is no record matching the
criteria, I'd like to move the associate name and date specified on Form A to
the new record, so that I don't have to re-enter it on Form B.

But I don't want to overwrite anything on Form B if it does come up with a
matching record.

Any solutions?

Thank you!
 
try adding the following code to FormB's Current event procedure, as

If Me.NewRecord Then
Me!AssociateName = Forms!FormA!AssociateName
Me!DateField = Forms!FormA!DateControl
End If

substitute the correct form, field, and control names, of course.

hth
 
Thank you!

tina said:
try adding the following code to FormB's Current event procedure, as

If Me.NewRecord Then
Me!AssociateName = Forms!FormA!AssociateName
Me!DateField = Forms!FormA!DateControl
End If

substitute the correct form, field, and control names, of course.

hth
 

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

Back
Top