There is no need to use DLookup to retrieve ID. Include field in combobox RowSource. Combobox properties:
RowSource: SELECT Id, [language] FROM Setlanguages_tbl ORDER BY [language];
BoundColumn: 1
ColumnCount: 2
ColumnWidths: 0";2"
Textbox and button not needed.
Code for Setlanguages_Frm
Code:
Private Sub Languagedl_AfterUpdate()
DoCmd.OpenForm "Login_Frm", , , , , , Me.Languagedl
End Sub
Code for Login_Form
Code:
Private Sub Form_Open(Cancel As Integer)
Me.languagetxt.SetFocus
Me.userlbl.Caption = DLookup("[" & Me.OpenArgs & "]", "[languages_tbl]", "[label]='userlbl'")
Me.passwordlbl.Caption = DLookup("[" & Me.OpenArgs & "]", "[languages_tbl]", "[label]='passwordlbl'")
Me.showpasswordlbl.Caption = DLookup("[" & Me.OpenArgs & "]", "[languages_tbl]", "[label]='showpasswordlbl'")
End Sub
An alternative to this code is to use textbox as "label" with expression:
=DLookup("[" & [OpenArgs] & "]", "[languages_tbl]", "[label]='userlbl'")
What is purpose of languagetxt textbox?