QueryDef Help Required

accesser

Registered User.
Local time
Today, 17:57
Joined
Mar 17, 2003
Messages
54
Hi,



I am trying to pass parameter to an existence query in my database but it doesn't completed successfully as follow:


dim myqd as querydef
dim db as database

set db=Currentdb

set myqd=db.querydefs("CashBal_Load_New_Entries")
myqd.Parameters("MaxEntry") = MaxEntry
myqd.Execute


The myqd.parameters("MaxEntry")=MaxEntry gives me the following error:
Object Variable or With Block Variable not set

Regards,
 
This is my sql

INSERT INTO CashBal_ACVW_ENTRIES ( AC_NO, DRCR_IND, LCY_AMOUNT, AC_ENTRY_SR_NO )
SELECT SICOLIVE_ACVWS_ALL_AC_ENTRIES.AC_NO, SICOLIVE_ACVWS_ALL_AC_ENTRIES.DRCR_IND, SICOLIVE_ACVWS_ALL_AC_ENTRIES.LCY_AMOUNT, SICOLIVE_ACVWS_ALL_AC_ENTRIES.AC_ENTRY_SR_NO
FROM SICOLIVE_ACVWS_ALL_AC_ENTRIES
WHERE (((SICOLIVE_ACVWS_ALL_AC_ENTRIES.AC_ENTRY_SR_NO)>[MaxEntry]));
 
MyQd.Parameters![MaxEntry] = Me!MaxEntry

I assume the MaxEntry is a field or combo box on an open form?
 
Or you can refer to the form directly from the query, saves you from having to pass it

Use the QBE to "build" your connection to the form.

Regards
 

Users who are viewing this thread

Back
Top Bottom