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

Very Basic VB tables query

Status
Not open for further replies.

AllenCoombs

Programmer
Oct 24, 2002
1
GB
I'm very new to VB (as in yesterday) so I suspect this is a very obvious question (which yes I have searched for but I suspect my complete ignorance doesn't allow me to see what I need to, any how).

What I am trying to do is filter the records before opening a form.

I can get this to work when I only filter on one table with this.

Function IIP50()
On Error GoTo IIP50_Err

DoCmd.OpenForm &quot;OrgContacts&quot;, acNormal, &quot;&quot;, &quot;[Organisations]![IIP]=True And [Organisations]![Add3]=&quot;&quot;Nottingham&quot;&quot; And [Organisations]![OrgName]<>&quot;&quot;&quot;&quot;, , acNormal&quot;


IIP50_Exit:
Exit Function

IIP50_Err:
MsgBox Error$
Resume IIP50_Exit

End Function

It's when I try and filter using criteria across joined tables that I fall. In short I'm trying to figure out the syntax for joined tables in VB as it pertains to Access Modules.
 
to use a joined table, you need to join the table within a query, then use the query for your record source...

Then the same type of filtering you used up top should work.

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top