?
Solved

I want to open a table to specific records using a drop down box on the form

Posted on 2016-08-10
2
Medium Priority
?
57 Views
Last Modified: 2016-08-17
I have a drop down box on a form that you select a client then I want to push a button that garbs those records in a table and displays them for editing.
The code im using is  

dim stLinkCriteria as string
stLinkCriteria = "[Client Name]=" & "'" & Me![SingleAcctName] & "'"
docmd.opentable "Structure", , stLinkCriteria

and Im getting a type mismatch

stLinkCriteria looks like this "[Client Name]='Home Depot'"
what am i doing wrong?
0
Comment
Question by:Stephen Roesner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 41750945
1. the OpenTable method does not support a where argument.
2. Never under any condition should users be presented with a raw table or query to update.  Always use a form.  Tables and queries do not have any event processing so there is no way for you to have any control over the data they enter.
3. If the user wants to edit in something that looks like a table, use a form in Data Sheet view.  When you use a DS form, it is generally best to make it a subform rather than a main form because a DS form does not support buttons or have a header or footer.  If you want to know how to make the subform work with criteria, post back.
0
 

Author Closing Comment

by:Stephen Roesner
ID: 41760195
Pat you are correct thats what I ended up doing
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question