473,507 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access, List box

48 New Member
I have a list box with different isssues and I would like that when the user selects one Issue a form will open with all fields but only that Issue. I used the code below, but it does not seem to work. My guess is that this might not be the way to do it. Can someone help?

Thank you.
Expand|Select|Wrap|Line Numbers
  1. Dim strSelect As String
  2.  
  3.         Select Case frmOptionY
  4.  
  5.              Case "ClassI"
  6.                 strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassI' '"
  7.  
  8.                 DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
  9.  
  10.              Case "Class II"
  11.                 strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassII' "
  12.                     DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
  13.  
  14.  
  15.              Case "Class III"
  16.                 strSelect = "SELECT * FROM qryIssue WHERE Issue = 'Class III' "
  17.                     DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
  18.  
  19.  
  20.  End Select
  21.  
  22. End Sub
  23.  
Oct 22 '07 #1
3 1249
Rabbit
12,516 Recognized Expert Moderator MVP
Please use code tags.

Expand|Select|Wrap|Line Numbers
  1. Dim strSelect As String
  2. strSelect = "Issue = '" & Me.frmOptionY & "'"
  3. DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
  4. End Sub
  5.  
Oct 22 '07 #2
margot
48 New Member
Please use code tags.

Expand|Select|Wrap|Line Numbers
  1. Dim strSelect As String
  2. strSelect = "Issue = '" & Me.frmOptionY & "'"
  3. DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
  4. End Sub
  5.  
Thank you so much!!!
Oct 22 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Thank you so much!!!
Not a problem, good luck.
Oct 22 '07 #4

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

Similar topics

3
6782
by: Kyle Teague | last post by:
I have a list of pointers to structs as a private member of a class. If I call begin() in the same function as I added the data then no access violation occurs. However, if I try to call begin() in...
8
3933
by: CoolPint | last post by:
I read in books that nested class cannot access private members of nesting class and vice versa unless they are made friends. Somehow, my compiler is letting my nested class member functions access...
14
5385
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
3
23994
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
6
4712
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
8822
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
52
9914
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
12
1901
by: David Isaac | last post by:
Is it expected for access to set elements to be much slower than access to list elements? Explanation? Thanks, Alan Isaac 9.806250235714316 3.9823075279120701
3
3501
by: rhobson2 | last post by:
Hello, I wrote a database applicaiton using Access XP (2002) and everything has been working good for the client until they purchased a couple of new computers with Access 2003. The meetings...
7
12287
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.