By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Open form if I click on data in a subform

P: 6
Dear All,
I have main form "Job" and one subform "Offer"
In a subform I have combo box Contacts.
How can I open form Contacts if I dbl click on a combo box in my subform where condition ID = Contacts!

Thank you in advance!
Sep 25 '08 #1
Share this Question
Share on Google+
3 Replies

P: 222
on event double click try to insert this code
Expand|Select|Wrap|Line Numbers
  2. Dim stDocName As String     
  3. Dim stLinkCriteria As String      
  4. stDocName = "Contacts"          
  5. stLinkCriteria = "[ID]=" & [contacts]  
  6. DoCmd.OpenForm stDocName, , , stLinkCriteria
Also you can you use from your toolbar create wizard button and ACCESS will create you the code

Sep 25 '08 #2

P: 6

I tried to insert your code but it is not correct.
Wrong: stLinkCriteria = "[ID]=" & [contacts]
Can't find this data!

Sep 25 '08 #3

P: 6
I find answer...
DoCmd.OpenForm "Contacts", , , "[cID]=" & [oCustomer], , acDialog
ID - primary key in a tabele Contacts
Customer - name of the combo box in a subform "Offer"

Sep 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.