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!

Pull Info from One Form to Another

Status
Not open for further replies.

MossC

Technical User
Apr 14, 2003
15
US
I am working with a form and when I click on a button, it opens a new form. The first form holds a bunch of comments and is a continuous form so if one file has 10 comments, all comments are seen.

When the button is clicked, it opens a form to enter a new comment.

What I want to do is to have the file number from the first form populate the New Comment form. Right now I have to manually input the file number.

On a similar note, another form uses tab controls and I want to bring a single file number to each of the tabs.

Thank you for your assistance.
 
Try something like the following, where Form2Name is the name of your comments form:

Dim FileNo
FileNo=Me!FileNumber
DoCmd.OpenForm "Form2Name"
DoCmd.GotoRecord,,acNew
Forms!Form2Name!FileNumber = FileNo

HTH
Chris
 
I tried that but what I need to do is then enter a new comment for that new FileNo. There may be 10 previous comments for that FileNumber or there could be 0.

When the code ran, it gave me an error "You can't go to the specified record."

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top