passing criteria from code



Hello all,

I'm trying to pass data from a control (subform) into a query. When I
run this get a 'Compile error: User defined type not defined' error on
the 'Dim db As Database' line. I'm using 2003. I know I've used
this code before (A97), but now it's not working. Has something
change or do I need to configure something?

I've removed the subform control from this, just to get it working
first.

Dim db As Database
Dim rs As Recordset
Dim qdfParmQry As QueryDef
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("Kits_PB")
qdfParmQry![Kit Name:] = "NikeSmoke"
Set rs = qdfParmQry.OpenRecordset()

thanks for the help.

mike
.



Relevant Pages

  • Re: Is this a Sound Database Design? -- procedurenames must be unique in same module
    ... Since these are PRIVATE functions, it is ok to have another Private function with this name in ANOTHER module sheet. ... Created a form with a subform in it, named it TabSubform and then created a command button, named it SwitchTabs. ... Dummy is an unbound control -- really tiny because I use labels instead of command buttons and a label does not get the focus ... Dim mCurrentTab As Integer, i As Integer, mBoo As Boolean ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Is this a Sound Database Design? -- code: SwitchTabs
    ... The "command buttons" (put in quotes because I actually used label ... Dummy is an unbound control -- really tiny because I use labels instead ... Sometimes, the subforms do not have linking fields, like a lookup subform ... Dim mCurrentTab As Integer, i As Integer, mBoo As Boolean ...
    (microsoft.public.access.tablesdbdesign)
  • Subform RecordsetClone No Current Record error
    ... of rows all displayed in an Access 2000 subform. ... The "after update" event of the form control ... Dim bCategoryValOpposite As Boolean ...
    (microsoft.public.access.formscoding)
  • Re: Is this a Sound Database Design? -- code: SwitchTabs
    ... The "command buttons" (put in quotes because I actually used label controls) to switch subforms are colored so that you can see which one is active ... TabID is an unbound control -- it is set when the form loads ... Sometimes, the subforms do not have linking fields, like a lookup subform ... Dim mCurrentTab As Integer, i As Integer, mBoo As Boolean ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Can I control which Tab is selected ... code to swap subform sourceObject
    ... The "command buttons" to switch subforms are colored so that you can see which one is active ... I define a calculated control on the subform and set it equal to the specified control on the main form for LinkMasterFields ... Dim mCurrentTab As Integer, i As Integer, mBoo As Boolean ...
    (microsoft.public.access.forms)