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

ReginaF

Registered User.
Local time
Today, 09:25
Joined
Sep 23, 2019
Messages
26
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.
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:25
Joined
Sep 21, 2011
Messages
14,299
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
 

ebs17

Well-known member
Local time
Today, 09:25
Joined
Feb 7, 2020
Messages
1,946
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:

ReginaF

Registered User.
Local time
Today, 09:25
Joined
Sep 23, 2019
Messages
26
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

Top Bottom