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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query's in Access2000 in VBA code

Status
Not open for further replies.

Warrior

Programmer
Apr 14, 2000
9
NL
Hello every one<br>i started to use access2000 <br>when i enter a select query statement as query this query runs fine<br>but when i put this query behind a button in the VBA code Access2000 gives the fault couldn't find object<br><br>this is the query<br>SELECT Stoffen.STOFNAAM, Stoffen.SYNONIEM_1, Stoffen.SYNONIEM_2, Stoffen.SYNONIEM_3, Stoffen.FORMULE, Stoffen.CAS_NUM, Stoffen.GEVAAR_SYM, Stoffen.MOL_GEW, Invoer.RUIMTE, Invoer.HOEVEELH, Invoer.EENHEID, Invoer.Plaatscode, Invoer.UGD, Invoer.datum, Invoer.leveranc, Invoer.zuiverh, Invoer.certnr, Invoer.lotnr, Invoer.memo<br>FROM Invoer RIGHT JOIN Stoffen ON Invoer.STOF_REF = Stoffen.STOF_REF<br>WHERE stofnaam like &quot;**&quot; or stofnaam like &quot;*benzeen*&quot;<br>ORDER BY Stoffen.STOFNAAM;<br><br><br>And this is the VBA code so far<br>Private Sub Knop0_Click()<br>Dim strSQL As QueryDef<br><br>Set QueryDef = kaart.CreateQueryDef(kaart, &quot;SELECT Stoffen.STOFNAAM, Stoffen.SYNONIEM_1, Stoffen.SYNONIEM_2, Stoffen.SYNONIEM_3, &quot; & _<br>&quot;Stoffen.FORMULE, Stoffen.CAS_NUM, Stoffen.GEVAAR_SYM, Stoffen.MOL_GEW, Invoer.RUIMTE, &quot; & _<br>&quot;Invoer.HOEVEELH, Invoer.EENHEID, Invoer.Plaatscode, Invoer.UGD, Invoer.datum, &quot; & _<br>&quot;Invoer.leveranc , Invoer.zuiverh, Invoer.certnr, Invoer.lotnr, Invoer.memo &quot; & _<br>&quot;FROM Invoer RIGHT JOIN Stoffen ON Invoer.STOF_REF = Stoffen.STOF_REF &quot; & _<br>&quot;ORDER BY Stoffen.STOFNAAM;&quot;)<br>DoCmd.OpenQuery kaart<br>End Sub<br><br><br>Could anyone tell me what i do wrong in here
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top