| | |
|
|
|
On Double Click |
| message from =?Utf-8?B?Sm9obkx1dGU=?= on 14 May 2004 |
How can I format a subform combo box to open it's record with a double-click?
Thanks!
|
| Dirk Goldgar replied to =?Utf-8?B?Sm9obkx1dGU=?= on 14 May 2004 |
"JohnLute" <anonymous@discussions.microsoft.com> wrote in message
news:425E21A8-61CE-416B-A1E8-B5C5A53276E7@microsoft.com
It's not clear to me what you mean. Do you want to position the subform
to the record whose key is selected in the combo box? Open a separate
form showing that record? Something else entirely?
|
| =?Utf-8?B?Sm9obkx1dGU=?= replied to Dirk Goldgar on 14 May 2004 |
The double click needs to open the form that's associated with the chosen record.
Thanks!
|
| Dirk Goldgar replied to =?Utf-8?B?Sm9obkx1dGU=?= on 14 May 2004 |
Suppose that the combo box is named "MyCombo", the form to be opened is
named "MyForm", and the combo box's bound column is equivalent to the
Private Sub MyCombo_DblClick(Cancel As Integer)
DoCmd.OpenForm "MyForm", _
WhereCondition:="ID=" & Me!MyCombo
End Sub
That assumes that ID is a numeric value. If it's a text value, this
variation will probably work:
DoCmd.OpenForm "MyForm", _
WhereCondition:="ID=""" & Me!MyCombo & """"
|
| =?Utf-8?B?Sm9obkx1dGU=?= replied to Dirk Goldgar on 14 May 2004 |
Thanks! I'm not sure I explained myself clearly. The combo box queries a table with that relates to multiple forms. In other words, the combo box needs to open any number of forms depending on the data that has been chosen.
If I follow your suggestion then the combo box is limited to opening just the particular form. My combo box needs to open any number of forms.
Can this be done?
|
| Dirk Goldgar replied to =?Utf-8?B?Sm9obkx1dGU=?= on 14 May 2004 |
"JohnLute" <anonymous@discussions.microsoft.com> wrote in message
news:0CD8745A-F60A-4667-BBB3-3BAD0A183D8B@microsoft.com
Probably, but you're going to have to explain a lot more. What is the
rowsource of the combo box? What do you want to have happen in various
specific circumstances? At the moment, I'm completely lost as to what
you're trying to do.
|
| =?Utf-8?B?Sm9obkx1dGU=?= replied to Dirk Goldgar on 14 May 2004 |
Sorry - thanks for sticking with me!
I have a table called tblProfiles. This stores info for multiple TYPES of records. The primary key is txtProfileID. The different TYPES of records are: CG, FG, BG, LA, PL, etc.
The combo box queries the txtProfileID, txtDescription and txtType fields in the tblProfiles. I need to be able to make a selection in the combo box and double click it to go to its form.
I'm guessing that this is too intricate for a combo box.
|
| Dirk Goldgar replied to =?Utf-8?B?Sm9obkx1dGU=?= on 14 May 2004 |
"JohnLute" <anonymous@discussions.microsoft.com> wrote in message
news:5EF578FB-EBB0-4379-9EC8-A8748150A8E1@microsoft.com
If the name of the form can be determined from the value of the txtType
column of the combo box, then it's not a problem. For example:
Select Case Me!cboProfile.Column(2) ' the third column
Case "CG"
DoCmd.OpenForm "Form1"
Case "FG"
DoCmd.OpenForm "Form2"
Case "BG"
DoCmd.OpenForm "Form3"
' ... and so on ...
End Select
Or, if the names of the forms are constructed from the types, you might
even do something like this:
DoCmd.OpenForm "Form" & Me!cboProfile.Column(2)
to open "FormCG", "FormFG", "FormBG", etc.
|
| =?Utf-8?B?Sm9obkx1dGU=?= replied to Dirk Goldgar on 14 May 2004 |
SUPER! Thanks a bunch, Dirk! I'll give it a shot first thing Monday!
|
|
Archived message: On Double Click (MS Access Database)