Hi everyone,
I'm trying to create a form to add records to a table "X".
I have a key code to identify every record from another table "Y": I like to autofill certain labels from the table "Y" when I insert the key, add some others with some combo boxes and then click on a button to add.
I tried with the form.recordsource, but I have two principal problems:
- obviously, it extends the source to every label, and so combo boxes go on error;
- when I click on the "add button" it adds none (maybe cause the labels are only in read form?).
Thank you so much!!
Below the code:
Private Sub findKey_AfterUpdate()
Dim KeyString As String
KeyString = " Select [Key] from TableY where ([Key] = '" & Me.findKey & "' ) "
Me.Form01.RecordSource = KeyString
Me.Form01.Requery
End Sub