good afternoon everyone,
I have a sql Table "AT_Abteilung" with three columns ID, Name, Description.
I created a form where I have a combobox, where I can select a name. If I choose
a name it should be able to show the description in the Textfield, where I can change the
content. For this I made a select statement, but it doesnt work. Could someone please give me a hint, what I am doing wrong?
Code:
Private Sub AT_NameCombo_Change()
Dim sSQL As String
Dim rs As DAO.Recordset
sSQL = "SELECT Description FROM Name WHERE = '" & Me.AT_NameCombo.Column(1) & "'"
Set rs = CurrentDb.OpenRecordset(sSQL, dbOpenDynaset, dbSeeChanges)
strText = rs!Description
strText = rs.Fields(1)
Me.DescriptionField = strText
End Sub
I have a sql Table "AT_Abteilung" with three columns ID, Name, Description.
I created a form where I have a combobox, where I can select a name. If I choose
a name it should be able to show the description in the Textfield, where I can change the
content. For this I made a select statement, but it doesnt work. Could someone please give me a hint, what I am doing wrong?
Code:
Private Sub AT_NameCombo_Change()
Dim sSQL As String
Dim rs As DAO.Recordset
sSQL = "SELECT Description FROM Name WHERE = '" & Me.AT_NameCombo.Column(1) & "'"
Set rs = CurrentDb.OpenRecordset(sSQL, dbOpenDynaset, dbSeeChanges)
strText = rs!Description
strText = rs.Fields(1)
Me.DescriptionField = strText
End Sub