Type MisMatch Error Associated With Dlookup Function On Form

R

R Tanner

Any ideas why I would get a Type Mismatch error when I try to run this
via code?

Dim MyInt As Long

MyInt = Me.SelectUnAppTicket.Column(1)

Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets", MyInt =
"[UnapprovedTickets]![PTID]")
 
D

Douglas J. Steele

Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets",
"[UnapprovedTickets]![PTID] = " & MyInt)

Of course, there's no reason for MyInt:

Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets",
"[UnapprovedTickets]![PTID] = " & Me.SelectUnAppTicket.Column(1))
 
R

R Tanner

Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets",
"[UnapprovedTickets]![PTID] = " & MyInt)

Of course, there's no reason for MyInt:

Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets",
"[UnapprovedTickets]![PTID] = " & Me.SelectUnAppTicket.Column(1))

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)


Any ideas why I would get a Type Mismatch error when I try to run this
via code?
Dim MyInt As Long
MyInt = Me.SelectUnAppTicket.Column(1)
Me.UnAppST = DLookup("[Start Time]", "UnapprovedTickets", MyInt =
"[UnapprovedTickets]![PTID]")

Yeah, I know, but I was having problems both ways, so I was just
trying to find a solution by trying different things...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top