data type mismatch at query, that should supply data to form (1 Viewer)

I do not know, you tell me. Go to table design view and tell me the datatype of tblSzovet.[Azonosító]
It could be text, double, long etc. I just can tell what it looks like, you can tell me what it is.
I think I mentioned it before, the data type is AutoNumber.
 
I have never prefixed the data with the query name if I am selecting from that query name?
I would just use Select * FROM queryname
 
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