I have searched about this and founs many familiar thread but it does not help with my forms.
So I have a form named frmTeilebeschaffung and it has a subform which displays some records and a button which will open a new form named frmDatumGueltigkeit.
What I want to do with my form is that when I click on a records on frmTeilebeschaffung and clicked on the button, the new form frmDatumGueltigkeit will open with the current record.
But it did not open the current record. It only displays the first ever record on the table.
See photo.
The VBA code on the button is
The VBA code for the new form frmDatumGueltigkeit is
Btw txtMANr is the name for the text box Messauftrag Nr on frmDatumGueltigkeit and txtMessauftragNr is the name for text box Messauftrag Nummer on frmTeilebeschaffung.
Did I miss any codes or link?
So I have a form named frmTeilebeschaffung and it has a subform which displays some records and a button which will open a new form named frmDatumGueltigkeit.
What I want to do with my form is that when I click on a records on frmTeilebeschaffung and clicked on the button, the new form frmDatumGueltigkeit will open with the current record.
But it did not open the current record. It only displays the first ever record on the table.
See photo.
The VBA code on the button is
Code:
Private Sub btnTeilVorOrt_Click()
DoCmd.OpenForm "frmDatumGueltigkeit", , , , , , "[txtMANr]='" & Me![txtMessauftragNr] & "'"
End Sub
The VBA code for the new form frmDatumGueltigkeit is
Code:
Private Sub Form_Load()
Me.RecordSource = "SELECT tblMessauftrag.* FROM tblMessauftrag ;"
End Sub
Btw txtMANr is the name for the text box Messauftrag Nr on frmDatumGueltigkeit and txtMessauftragNr is the name for text box Messauftrag Nummer on frmTeilebeschaffung.
Did I miss any codes or link?