Probably very basic, but I'm missing the correct syntax to take the value from a text-box field on a form and assign that value to a field in the database, current row.
The form properly opens to the next new row. This is a "child" form that opens when an "add record" button is pressed on the parent form.
Form fields directly linked to the DB via "select fields" options take entered data as you would expect. After using the form I check the DB and the new row was posted, with those fields filled in. The two fields I'm tinkering with are blank in the DB record because I don't have that handled correctly yet.
Those two fields are to receive openarg data from the parent form. I'm testing my basic form first just entering data to those, and looking to see that data posted to their fields.
Short Version: MS-Access form, most fields populated from the select fields function, but two fields as text-boxes. When I perform a "DoCmd.GoToRecord acDataForm, "EmplTrainLogMaint", acNewRec" a new row is properly created.
When I fill in all the fields on the form, they populate the database row properly except the two text boxes to their respective field destinations in that row. This is undoubtedly very basic syntax, just working this out at work amidst other duties.
Current attempt:
"Private Sub btnPostTraining_Click()
[emplTrainLog]![EmplID] = Me.TraineeID
Refresh
End Sub"
The "Refresh" actually posts the acNewRec transaction. I had assumed a simple reference to the table!field vs textbox on the form would be sufficient.
Thanks for your patience.
The form properly opens to the next new row. This is a "child" form that opens when an "add record" button is pressed on the parent form.
Form fields directly linked to the DB via "select fields" options take entered data as you would expect. After using the form I check the DB and the new row was posted, with those fields filled in. The two fields I'm tinkering with are blank in the DB record because I don't have that handled correctly yet.
Those two fields are to receive openarg data from the parent form. I'm testing my basic form first just entering data to those, and looking to see that data posted to their fields.
Short Version: MS-Access form, most fields populated from the select fields function, but two fields as text-boxes. When I perform a "DoCmd.GoToRecord acDataForm, "EmplTrainLogMaint", acNewRec" a new row is properly created.
When I fill in all the fields on the form, they populate the database row properly except the two text boxes to their respective field destinations in that row. This is undoubtedly very basic syntax, just working this out at work amidst other duties.
Current attempt:
"Private Sub btnPostTraining_Click()
[emplTrainLog]![EmplID] = Me.TraineeID
Refresh
End Sub"
The "Refresh" actually posts the acNewRec transaction. I had assumed a simple reference to the table!field vs textbox on the form would be sufficient.
Thanks for your patience.