Using Form record Selectors

kirkm

Registered User.
Local time
Today, 13:42
Joined
Oct 30, 2008
Messages
1,257
My Forms On Load Event gets a picture from OpenArgs (which has the picture path and filename)

Code:
Me.Picture = Me.OpenArgs
It works great but I'd like to have more than one picture and use the Record selectors to move through them.
Where should the code go to execute when the record selectors are clicked, and what sets the number for showing 1 of xx ?
Thanks for any info.
 
My Forms On Load Event gets a picture from OpenArgs (which has the picture path and filename)

Code:
Me.Picture = Me.OpenArgs
It works great but I'd like to have more than one picture and use the Record selectors to move through them.
Where should the code go to execute when the record selectors are clicked, and what sets the number for showing 1 of xx ?
Thanks for any info.
You should be storing all this in a table, where records list (among other data elements), picture paths. One record per picture. Presumably multiple records per-somet-other-entity.

Then you'd be scrolling through a recordset, as a Form typically does, grabbing picture information from a column in the Recordsource
 
Thanks Issac... will try. So the On Current event code would assign the picture?
The table would hold all the picture filespecs and the Record source for the Form would be that table (or query) ?
 
Thanks Issac... will try. So the On Current event code would assign the picture?
The table would hold all the picture filespecs and the Record source for the Form would be that table (or query) ?
It's up to you how you want to trigger the picture. OnCurrent would probably work.

Yes, the table or query would hold the information and that would be the recordsource
 
Hmm, I wonder if a TempVar would work for this purpose. Just thinking out loud...
 
Not sure what a tempvar is dbGuy?
I have the following
Code:
Private Sub Form_Current()
    Msgbox "Current"
End Sub

Private Sub Form_Load()
    If Nz(Me.OpenArgs) > "" Then
        Me.RecordSource = "Select Path from tblImages Where path Like '" & MyImageDir & Me.OpenArgs & "*';"
        DoCmd.MoveSize 6000, 3000, 10 * 1440, 8 * 1440
    End If
End Sub

The first problem is Form Current doesn't run when I click on the record selectors. It does display 1 of xx and increment them although I can move to xx+1 which I'll need to stop as xx+1 won't contain a picture.
What event is fired when you click on a record selector ?
 
Hi. Not in front of a computer right now, but see if there's a Click event for a Form and maybe try that.

Sent from phone,,,
 
Hmmm can someone help me with this.
What made him say "it works like a charm" ?
It is not possible to detect a click on the record selector ? Please let me know so I can stop trying
I find Selection change is no good. On current no good. Detail click and Form_Click is no good either (on Rec selectors).
 
Hmmm can someone help me with this.
What made him say "it works like a charm" ?
It is not possible to detect a click on the record selector ? Please let me know so I can stop trying
I find Selection change is no good. On current no good. Detail click and Form_Click is no good either (on Rec selectors).
I suspect the Current event worked for them because their situation is different than yours. Not sure about your setup, but the record selector has a specific purpose. When I use a single view form, I don't even display it. So, it's mostly useful for continuous forms. In your case, I thought the form's Click event would be what you wanted.

Sent from phone...
 
Thanks DBGuy. The click event works on the Form but not when you click the record selectors. At least here.
However in another db I have clicking on rec selctors DOES reach Form_Current. So it must be my Form and something not set up right.
 
Thanks DBGuy. The click event works on the Form but not when you click the record selectors. At least here.
However in another db I have clicking on rec selctors DOES reach Form_Current. So it must be my Form and something not set up right.
If you can post a sample copy, we can help you troubleshoot.
 
As theDBGuy said and Microsoft as well
On a form, this event occurs when the user clicks a blank area or record selector on the form.

 
I haven't actually got a DB it's just a Form to use as a picture display. But it's kindof cool as I can grab the corner are resize. This may be quite common but it's the only Form I've managed to do this with!
That aside attached is what I have. The table holds the image paths which aren't part of it. You can add some jpgs and put their names into the table?
What has come unstuck is assigning Me.Picture while moving through the with the record selector.
Hope it all makes sense. Thanks.
 

Attachments

Use a bound image control. No code is required. Just bind it to the field.
 
> On a form, this event occurs when the user clicks a blank area or record selector on the form.
Which event is that? In the fileI atatched there's 3 or 4 Msgboxes in various events. But none of them work.
 
Also do not store the path in the field. Store only the name. Store the path in another applications setting table. This way you can change the path at any time in one place only. Then do a query of the path and the names and concatenate the names to the path. Then bind your image control to that field.
 
> Use a bound image control. No code is required. Just bind it to the field.
Can I get the record selector problem resolved first ?
 
I'm using that event and a click on the record selectors is ignored.
So more must be involved ?
 
Can I get the record selector problem resolved first ?
Yeah, I already did that. If I am using a bound control then whatever record I am on the image shows. No code, so no event needed. So I could care less how you get to the record, it is going to display.
 

Users who are viewing this thread

Back
Top Bottom