Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 25th, 2016, 05:25 PM
damian.green damian.green is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2016
Posts: 1 damian.green User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 51 sec
Reputation Power: 0
Question Docmd.openform Query on 2 criteria

I'm trying to open a form and have it filtered on 2 criteria [LIN] and [MACOM]. I've got the filter working for the 1st criteria. How do I modify the code to filter also on [MACOM]?

Private Sub FY16_req_Click()
DoCmd.OpenForm "frmmktbFMS_Type_REQ_Auth_by_FY_UIC_LIN", , , "[LIN]='" & Me.LIN & "'"
End Sub

Reply With Quote
  #2  
Old May 28th, 2016, 11:43 AM
informer informer is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2016
Posts: 10 informer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 33 m 52 sec
Reputation Power: 0
Hi damian.green

Code:
DoCmd.OpenForm "frmmktbFMS_Type_REQ_Auth_by_FY_UIC_LIN", , , "[LIN]='" & Me.LIN & "' AND [MACOM] = '" & Me.MACOM & "'"
'if MACOM is number type without single quote




When you use filter with criteria, imagine buid a SQL query as followq
SELECT Field List FROM RecordSource WHERE Criteria, so WHERE is implicit for the first criteria (here LIN) but as in SQL query you add AND / OR / IN and so an

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Docmd.openform Query on 2 criteria


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap