473,228 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,228 software developers and data experts.

Combo dropdown list box (on Switchboard)-How to open a specific row?

What I'm trying for: If this selection or if click on selection
(highlighted line choice/
which ever selection change) w/in query's combo dropdown list box (on
Switchboard),
then Open in Datasheet View, the specific underlying record's Row...
showing all columns Or selected columns.

For a specific row's record ONLY, Or for all Xs (same type), or for the
whole data sheet
(all records... includes all types then), but focus still opens on the
specific selection.

Is there anyone that knows how to do this & explain using correct
syntax, in simplest clear terms? Here's what I have (record source
is query):
Private Sub QueryQ_Click()
If Me.[TableNameABC]![FieldX] Then
Me.[FieldX:Yes] = "x"
End If
If Me.[TableNameABC]![FieldY] Then
Me.[FieldY:Yes] = "y"
End If
If Me.[TableNameABC]![FieldZ] Then
Me.[FieldZ:Yes] = "z"
End If
Hope this is clear. THANKS in advance!!

Aug 1 '06 #1
3 3818

Cagey wrote:
What I'm trying for: If this selection or if click on selection
(highlighted line choice/
which ever selection change) w/in query's combo dropdown list box (on
Switchboard),
then Open in Datasheet View, the specific underlying record's Row...
showing all columns Or selected columns.

For a specific row's record ONLY, Or for all Xs (same type), or for the
whole data sheet
(all records... includes all types then), but focus still opens on the
specific selection.

Is there anyone that knows how to do this & explain using correct
syntax, in simplest clear terms? Here's what I have (record source
is query):
Private Sub QueryQ_Click()
If Me.[TableNameABC]![FieldX] Then
Me.[FieldX:Yes] = "x"
End If
If Me.[TableNameABC]![FieldY] Then
Me.[FieldY:Yes] = "y"
End If
If Me.[TableNameABC]![FieldZ] Then
Me.[FieldZ:Yes] = "z"
End If
Hope this is clear. THANKS in advance!!
I *think* I understand. You want to choose which field to filter by.
If you're filtering a report or form's records, then it's easy.

I think your problem is that you're not filtering by a single field.
IOW, [Field1]={some value], but a group of possible fields. The only
way to do that is to build the Where clause on the fly and then pass
the where clause in the open event of the form/report.

Private Sub cmdOpenEmployeeForm_Click()
DoCmd.OpenForm "frmEmployee", acNormal, , "EmployeeID=" &
Me.Combo2, acFormEdit, acDialog
End Sub

otherwise, you need to build the where clause on the fly.

say you have
an unbound combobox of field names: cboFieldName
an unbound textbox where you can type in a text value: txtValue

Private Sub cmdOpenEmployeeForm_Click()
dim strFilter as string
const cQUOTE as string ="'"
strFilter = "[" & Me.cboFieldName & "] = " & cQUOTE & Me.txtValue &
cQUOTE

DoCmd.OpenForm "frmEmployee", acNormal, , strFilter, acFormEdit,
acDialog
End Sub

or did you mean something else?

Aug 1 '06 #2

pi********@hotmail.com wrote:
Cagey wrote:
What I'm trying for: If this selection or if click on selection
(highlighted line choice/
which ever selection change) w/in query's combo dropdown list box (on
Switchboard),
then Open in Datasheet View, the specific underlying record's Row...
showing all columns Or selected columns.

For a specific row's record ONLY, Or for all Xs (same type), or for the
whole data sheet
(all records... includes all types then), but focus still opens on the
specific selection.

Is there anyone that knows how to do this & explain using correct
syntax, in simplest clear terms? Here's what I have (record source
is query):
Private Sub QueryQ_Click()
If Me.[TableNameABC]![FieldX] Then
Me.[FieldX:Yes] = "x"
End If
If Me.[TableNameABC]![FieldY] Then
Me.[FieldY:Yes] = "y"
End If
If Me.[TableNameABC]![FieldZ] Then
Me.[FieldZ:Yes] = "z"
End If
Hope this is clear. THANKS in advance!!

I *think* I understand. You want to choose which field to filter by.
If you're filtering a report or form's records, then it's easy.

I think your problem is that you're not filtering by a single field.
IOW, [Field1]={some value], but a group of possible fields. The only
way to do that is to build the Where clause on the fly and then pass
the where clause in the open event of the form/report.

Private Sub cmdOpenEmployeeForm_Click()
DoCmd.OpenForm "frmEmployee", acNormal, , "EmployeeID=" &
Me.Combo2, acFormEdit, acDialog
End Sub

otherwise, you need to build the where clause on the fly.

say you have
an unbound combobox of field names: cboFieldName
an unbound textbox where you can type in a text value: txtValue

Private Sub cmdOpenEmployeeForm_Click()
dim strFilter as string
const cQUOTE as string ="'"
strFilter = "[" & Me.cboFieldName & "] = " & cQUOTE & Me.txtValue &
cQUOTE

DoCmd.OpenForm "frmEmployee", acNormal, , strFilter, acFormEdit,
acDialog
End Sub

or did you mean something else?
Just making sure we're on the same pg... I'd like to be able to enter
directly into a row on a dropdown which pulls from either a query or
directly from a table. This query's dropdown is on the Switchboard (if
that matters). Phoney Ex. -
Row 1 || Name1 || Name2 || Name3
Row 2 || Descrips
Row 3 || Labels today || Labels yesterday 45 || More
Row 4 || Labels today || Labels yesterday 410
Query may narrow database records' view to 3 or 4 columns w/in the
dropdown list like above ex. (|| represents column end here), but maybe
the user wants to click into Row 3, so they can pick/go directly to
line of info. selected, either showing only that line, plus all it's
other columns (additional columns - same line in the database, but not
part of query), or go directly to that line, while allowing user to see
all database columns/rows (records), rather than having to scroll or
search for the line they wanted. It sounds like I may be asking
something diff. than what you answered?? Not sure. Please let me know.
THANKS!!!

Aug 2 '06 #3
Just making sure we're on the same pg... I'd like to be able to enter
directly into a row on a dropdown which pulls from either a query or
directly from a table. This query's dropdown is on the Switchboard (if
that matters). Phoney Ex. -
Row 1 || Name1 || Name2 || Name3
Row 2 || Descrips
Row 3 || Labels today || Labels yesterday 45 || More
Row 4 || Labels today || Labels yesterday 410
Query may narrow database records' view to 3 or 4 columns w/in the
dropdown list like above ex. (|| represents column end here), but maybe
the user wants to click into Row 3, so they can pick/go directly to
line of info. selected, either showing only that line, plus all it's
other columns (additional columns - same line in the database, but not
part of query), or go directly to that line, while allowing user to see
all database columns/rows (records), rather than having to scroll or
search for the line they wanted. It sounds like I may be asking
something diff. than what you answered?? Not sure. Please let me know.
THANKS!!!
Ify ou want to change the controlsource of your combobox on the fly,
you'd have to do it with code. I think that's what you mean, because
there's no other way to change the number of columns returned by a
query. (Well, unless you change the controlsource of the combobox to
some other query object or SQL statement. And then you'd have to
change the number of columns shown in the combobox control. but I'm
completely guessing what you're talking about. how about a REAL
example, because most of what you've said so far, at least from a pure
database standpoint, doesn't make much sense to me. Again, maybe I'm
missing the point, but so far nobody else has answered...

If all you _really_ want is to filter a form in the open event of the
form (as the subject says), so you see only all the records with a
field value in common, then that's a walk. All you have to do is
specify a filter (valid WHERE clause without the "WHERE") in the Open
event of the form.

But the way you are talking about varying numbers of columns in your
combobox, I'm not sure what you're really after. So how about giving a
real example?

Thanks,
Pieter

Aug 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
3
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled...
1
by: Dale Geffs | last post by:
I have a form with a combo box and when it (combo) gets focus I issue a .dropdown. Using A2K and SP1 everything works fine and the list drops down under the control as expected. If I use a PC with...
4
by: Theo Jansen | last post by:
Hi, i'm making an application in Access and in the query made, i'd like the user to fill in a parameter when opening the query (in a report). It's much easier for the user if the parameter was a...
4
by: Steve Le Monnier | last post by:
I have a textbox with a lookup button facility. What I would like to do is also offer a quick selection facility by having a dropdown list appear under the control once the user has typed a single...
2
by: Abdhul Saleem | last post by:
Hi, Any code snippet or help link available on how to auto resize the dropdown list part of the combo(<select>) ? Or, is there any alternative techniques for displaying the full lenth text...
2
by: SF | last post by:
Hi, I am new to ASP.NET. I have started to create a new ASP.NET web. I can succesfully insert a table into a form but my form does not look good becuase some filed (from table) are foreigh key...
3
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hello, friends, We use System.Windows.Forms.ComboBox in our c#.net 2005 app. We want to make the dropdown list wider than the comboBox's width. (Some items in the dropdown list have more...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.