data type mismatch at query, that should supply data to form

Code:
If IsNull(Me.OpenArgs) Then
    Me.RecordSource = "qry_SzovetTarolas"
Else
    Me.RecordSource = "SELECT qry_SzovetTarolas.* FROM qry_SzovetTarolas WHERE qry_SzovetTarolas.[Azonosító] = " & CLng(Me.OpenArgs)
    'Me.RecordSource = "SELECT * FROM qry_SzovetTarolas WHERE [Azonosító] = " & CLng(Me.OpenArgs)
End If

FROM qry_SzovetTarolas ?? tblSzovet.[Azonosító]
In the query, only fields from the "table" can come from the FROM part.

OpenArgs returns NULL or a string. A passed number must be converted back into a number using a type conversion.
 
Last edited:
Code:
If IsNull(Me.OpenArgs) Then
    Me.RecordSource = "qry_SzovetTarolas"
Else
    Me.RecordSource = "SELECT qry_SzovetTarolas.* FROM qry_SzovetTarolas WHERE qry_SzovetTarolas.[Azonosító] = " & CLng(Me.OpenArgs)
    'Me.RecordSource = "SELECT * FROM qry_SzovetTarolas WHERE [Azonosító] = " & CLng(Me.OpenArgs)
End If

FROM qry_SzovetTarolas ?? tblSzovet.[Azonosító]
In the query, only fields from the "table" can come from the FROM part.

OpenArgs returns NULL or a string. A passed number must be converted back into a number using a type conversion.
Thank you! your solution worked :)
 

Users who are viewing this thread

Back
Top Bottom