Have a text box on form B equal what’s in a form A text box

Mr. SLP

Registered User.
Local time
Today, 06:34
Joined
Dec 23, 2017
Messages
56
I have a button on form A that brings up form B for me to choose items to assign to the student represented in form A. Form B references a query to show only unassigned items. I have a checkbox and want to set it so that the foreign key in form B will be set to match the primary key of form A on check... I can’t seem to figure out how to reference the current status on a field on a different form to affect the value of a field on the current form.


Sent from my iPhone using Tapatalk
 
Last edited:
I think I should’ve mentioned that form B is a data sheet. Not sure if that makes a difference.


Sent from my iPhone using Tapatalk
 
Where us the chkbox, form a or b?
 
Use the chkbox after update event:

Privare sub assign_afterupdate()
If me.assugn then

Forms!FormA!StydentId=Me.Studentid
End if
End sub
 
Last edited:
Where us the chkbox, form a or b?



Checkbox is on B.

This is what I currently have but it’s not working
Private sub assign_click()
if me.assign=true then
Me.student=forms!ipads!studentID
ELSE
me.student= 11
End if
End sub

Form iPads= form A
Form B= add_apps


Sent from my iPhone using Tapatalk
 
Hi

The Normal method to add child records in a Form is to have a Standard Main Form and Subform layout so that the Foreign Key in the Subform is automatically added by Access.
 
Finally got it. Figured out. The problem was unrelated to this and I feel dumb. Thanks guys


Sent from my iPhone using Tapatalk
 

Users who are viewing this thread

Back
Top Bottom