I don't know the easiest way of doing this, but I have tried a couple of different ways of trying to write the data.
Right now I have 4 textboxes that call upon an answer in form 1
Controlsource:
Code:
=[Forms]![PolandNETSQForm]![Wren ID]
=[Forms]![PolandNETSQForm]![Sample Name]
=[Forms]![PolandNETSQForm]![Test Type]
=[Forms]![PolandNETSQForm]![Facility]
This pulls the info from PolandNETSQForm (Form 1) and brings it to my second form.
Next using VBA scripts I write these answers to form 2
Code:
Private Sub Form_Load()
Facility = Me.FormFacility
Wren_ID = Me.FormWrenID
Sample_Name = Me.FormSampleName
Test_Type = Me.FormTestType
End Sub
Then I use another VBA script that is based off a button I made called Command708
This code however does not take the information from the table and bring it to the next table or even the form doesnt bring it over.
Code:
Private Sub Command708_Click()
DoCmd.RunSQL "INSERT INTO PolandNETResults (Wren_ID, Test_Type, Facility, Sample_Name) VALUES (" & Wren_ID & ", " & Test_Type & ", " & Facility & ", " & Sample_Name & ");"
CurrentDb.Execute "INSERT INTO PolandNETResults (Wren_ID, Test_Type, Facility, Sample_Name) VALUES (" & Wren_ID & ", " & Test_Type & ", " & Facility & ", " & Sample_Name & ");"
DoCmd.Save([acForm],[PolandNETResults Query])
Me.Requery
End Sub
So is there a better way of entering those 4 fields so they fill out both forms (they need to be connected anyways, one is a status page the other is a results page for a sample)
Or is there a way that I can get one form to either write in new data if it doesnt exist and if it does exist just open up the existing data.