Solved

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

Posted on 2016-08-10
2
51 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 36

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

679 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