Solved

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

Posted on 2016-08-10
2
35 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:Grizbear51
2 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 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:Grizbear51
ID: 41760195
Pat you are correct thats what I ended up doing
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now