Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch error happens after conversion to Access 2007 1

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I recently converted an access 2003 database to Access 2007. Everything has worked fine except for getting a Type Mismatch (Run time error '13') on "Forms!frmQueryPaymentAA.BuildSQLExisting 'Transfers selected query name to the base form" line. I changed the Sub from Private to Public after reading on some forums that Private could cause a problem but that did not help. Is there a fix for this? Here is the code:


Public Sub cmdPaymentReturn_Click()

If IsNull(Me.lstQuery) Then
MsgBox "You have not selected a query. Either select a query or close the form to construct a new query"
Exit Sub
End If

Forms!frmQueryPaymentAA.BuildSQLExisting 'Transfers selected query name to the base form
DoCmd.Close

End Sub
 


hi,

Exactly what is BuildSQLExisting?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
BuildSQLExisting is a Public Sub in frmQueryPaymentAA.
 
Try putting a breakpoint in the function (hit F9 on the first executable line), then inspect the different values within the function by stepping through it (F8), by hovering the mouse over the variables, use the watch window etc...

You might consider using another test on the list, assuming it is a listbox, for insance:

[tt]If (Me!lstQuery.ListIndex <> -1) Then[/tt]

Try also if there's any difference if you make it a public sub (i e, put it in a standard module, not a form/report class module)

Anyway, there are a couple of Access fora on this site - to be specific 7, this might possibly get more answers in one of them, perhaps forum705 or forum702

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top