Double Click Anywhere in a Continuous Form

padlocked17

Registered User.
Local time
Today, 14:15
Joined
Aug 29, 2007
Messages
276
All,

I've got a Continuous form that has all the fields Enabled = No and Locked = Yes.

I'm attempting to make this form "itunes like" in the sense that any row can be double clicked and that row will take the focus and also open another form.

I tried using a transparent rectangle as a "hot spot" but it only works if the rectangle is not transparent. I have since moved to using a label and an event on the double click of that and it works like a champ.

What I'm unsure of how to do is to get a particular row to take the focus so that any subsequent forms I open are using the correct record to filter.

Anyone have any advice on how to do this?
 
Because of the way that non-bound controls work on a Continuous form, I think you're going to have to Use Enabled = Yes and Locked = Yes, then use the DoubleClick event of one or more Controls (i.e. bound Textboxes) to do this with.

DoubleClicking on the Control will take the focus to the given record and you can go from there.

Linq ;0)>
 
It's a bit of a head banger but it looks doable.

A2K3 demo attached.

Chris.
 

Attachments

That is just awesome. I would not have thought of this is a million years. Now my only question is if the form is based off a query, is that txtSelectedRecord checkbox and then Yes/No datatype required that what is it actually doing? How would I integrate that into a query if it's needed (which I'm assuming it is).
 
Upon looking into it further it appears the recordset has to be updatable. I'm using a query that is not able to be updated.

Any way to modify this to work that way?
 
To highlight the current record, with the method already provided, we need an updatable recordset which contains a Boolean field.

Other than that, to indicate which record is selected we could turn the Form's Record Selectors on.

Chris.
 
Now by turning the record selectors back on how would I go about modifying what you provided to still do the same thing? I'm not opposed to having the record selectors, I just want to allow for the double click in the row as well.
 
Chris -

I appreciate it. I hate asking for people to actually post up the db with the work done, but I very much appreciate it.

-Russ
 
No problems…

I've had that one, in one form or another, for about 8 years and you are the first to ask for it in a non-updatable recordset.

So it really doesn't matter how many times we have done it before there is always another twist to things that requires doing it again.

Are you sure you can't make the query updatable?
I ask that because you want to take the ID to a new Form so you may not need all the info you have in the continuous Form.

Just a thought.

Regards,
Chris.
 
Chris -

To bother you a little more.

I can't make the recordset updateable as it's using multiple tables to populate the data and I'm essentially using the continuous form as a listbox in functionality since I can't stylize a listbox to fit in the database.

I'm trying to take the non-updateable recordset example that you gave me and set it up to filter a parent form based on the ID of the currently selected record.

I've got the following in the Form_Current event, and it works most of the time, but sometimes a combination of clicking a record and using the arrow keys will cause the wrong ID to be used. It typically uses the ID of the record that was previously selected and not the one that you are actively selecting. Any ideas?

Code:
Me.Parent.Form.Filter = "MissionID = " & Me.txtMissionID & ""
MsgBox "MissionID = " & Me.txtMissionID
Me.Parent.Form.FilterOn = True
 
It looks like the Record Selectors on the Continuous Form do not keep track of the selection made.
We can use the same criteria used to filter the Parent Form to also Bookmark the Continuous Form.

Code:
Private Sub Form_Current()
    Dim strCriteria As String

    strCriteria = "MissionID = " & Me.txtMissionID

    Me.Parent.Form.Filter = strCriteria
    Me.Parent.Form.FilterOn = True
    
    Me.RecordsetClone.FindFirst strCriteria
    Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub

Chris.
 
why dont yuo make the fields enabled=yes, locked=yes

it will look the same, but then you can have event handlers to do what you want. maybe just the current event would work.
 
>>it will look the same<<

Dave, look the same as what; have you tried it?
Please post your testing db, Access 2003 or less please.

Mine is attached.

Chris.
 

Attachments

I have a question that appears to be a twist on this thread. I need for a double click on a record appearing on the continuous form to open a data entry form bound to the selected record. Here's the simplified scenario: Law office. Cases. Activities logged for each case. Two tables: cases and activities. I need for the continuous form (listing cases) to open a popup form that will allow an activity to be logged for the selected case. I have attached a sample database. It's based on the COntinuousFormSelectionA2K3 sample from this string. To that table I have added an "activities" table, established a 1-2-M relationship between the Cases and Activities tables, and created a popup form for logging activities. Right now, now the popup form, the case is selected via a combobox sourced to the Cases table. I want to use the continuous form instead. I'm stumped.
 

Attachments

Hi jmbreland,

It's probably best to use a new thread rather than re-open a 4 year dormant one, but here's my suggestion for your issue:

Place the button across the continuous form to get "focus" and trigger the form's onCurrent code.
In the form>onCurrent, place the record ID into a text field called currentID on a parent form. (Use continuous form as a subform on a new "holder" form, parent form can be unbound and just have a header, close/quit button and this new hidden text field for currentID)
On the button on the continuous form, set onDblClick to open the Activity form as a popup, and set the Case on that newly opened form to the parent_form.currentID

I hope that helps,

Don
Have a great day
 

Users who are viewing this thread

Back
Top Bottom