Can anyone help me with this code?
I have a button in a form and when I press this button I want a messagebox showing me the value from a vield in a specific table.
Dim db As Database
Dim qdf As QueryDef
Dim strSQL As String
strSQL = "SELECT BANKSALDO FROM BANKEN WHERE BANKNAAM = '" & BANKID.Value & "';"
Set db = CurrentDb
Set qdf = db.CreateQueryDef("test1", strSQL)
MsgBox (qdf("BANKSALDO"))
It's now in the sub and it doesn't work :'(
Do I have to put it in a function? I prefear it in the sub of the button.
Thx a lot for u help![]()



Reply With Quote