473,382 Members | 1,752 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,382 software developers and data experts.

Record Selector [Event Procedure]

All,

I am trying to have something happen on a form whenever the record selectors are clicked. This is access 2003. I tried the form's click event and that does not work at all.

Anyone know how I can get a procedure to trigger everytime the form's record selector is pressed?

Thanks to everyone. This is driving me crazy and any help that can be offered is greatly appreciated.

Thanks!
May 13 '08 #1
10 34123
missinglinq
3,532 Expert 2GB
When you click on the record selector you're moving to another record, and the form's OnCurrent event is triggered, so that would be the appropriate event for whatever you're trying to do.

Linq ;0)>
May 13 '08 #2
FishVal
2,653 Expert 2GB
Hi, jschmidt.

Actually there is no specific event to respond to record selector click.
But with a little workaround it could be sorted.
When record selector is clicked Form_Click event is fired, but it is fired as well when other form area (but the objects firing their own click event, e.g. detail section background, controls etc.) receives mouse click.
You may try to distinguish between these clicks using Form.SelHeight property which returns how many rows are selected. Really, when you click on record selector one row is selected otherwise no row is selected.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Click()
  2.     If Me.SelHeight = 1 Then
  3.         'code handling record selector click goes here
  4.         MsgBox "Record selector clicked"
  5.     End If
  6. End Sub
  7.  
Regards,
Fish

P.S. Actually, this doesn't work in datasheet view when record is already selected.
May 13 '08 #3
missinglinq
3,532 Expert 2GB
I'm sorry, but when the Record Selector is clicked, the OnCurrent event does fire, even in Datasheet View, does it not?

Linq ;0)>
May 14 '08 #4
FishVal
2,653 Expert 2GB
I'm sorry, but when the Record Selector is clicked, the OnCurrent event does fire, even in Datasheet View, does it not?

Linq ;0)>
I'm sorry too, but no Form_Current event is fired when clicking on record selector. I mean this bar on the left side of the form where triangle and pen icons appear.
Do you mean the same or do you mean navigation bar?
May 14 '08 #5
missinglinq
3,532 Expert 2GB
What do you think happens when you "click" on the record selector? Access moves from whatever record has focus to the record you clicked on. This record then becomes the the "current" record!

Place this code behind a datasheet form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.  MsgBox "The OnCurrent Event has fired!"
  3. End Sub
  4.  
Now click on the Recored Selector and see what happens.

Linq
May 14 '08 #6
FishVal
2,653 Expert 2GB
Apologies, Linq.

And what will happen if you click on record selector of current record? In single form view there is no other option. ;) And what If you just move to another record?

Kind regards,
Fish
May 14 '08 #7
missinglinq
3,532 Expert 2GB
And what will happen if you click on record selector of current record? In single form view there is no other option. ;) And what If you just move to another record?
Nothing would happen, of course! But why would you want whatever code the OP wants to tie to the event to happen again? The record selector isn't a command button, to be clicked willy-nilly; its purpose is to move to another record.
May 14 '08 #8
FishVal
2,653 Expert 2GB
Nothing would happen, of course! But why would you want whatever code the OP wants to tie to the event to happen again? The record selector isn't a command button, to be clicked willy-nilly; its purpose is to move to another record.
Post deleted, content PMed.
May 14 '08 #9
NeoPa
32,556 Expert Mod 16PB
It is nevertheless true that the Form_Current() procedure does not directly reflect clicking on a record selector I'm afraid Linq.

There are other ways of navigating between records than using the record selectors. I suspect it's also true to say that clicking on the record selector of the current record will not trigger the event.

It may possibly be used as an acceptable approximation, but it's not a direct answer for the question. Without knowing exactly what the OP requires we can only guess what may be acceptable for their particular requirements.
May 15 '08 #10
@missinglinq
Linq

Works like a charm! I needed a combo box to show or not show based on the value of another control while viewing records using the record selectors. After unsuccessfully trying a number of events I decided to search online. Bingo...the very answer I was searching for. Thank you much!
Apr 23 '13 #11

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

Similar topics

5
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have...
1
by: Steve | last post by:
I have a form with about 30 fields. Much of data entry for this form involves the same data for many of the fields. To save typing time, in the form's AfterUpdate event I run a procedure that sets...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
1
by: wheel | last post by:
I have been ok with optimistic locking most of the time but I have a situation now where there is more of a chance that users could try to edit a record at the same time. I'd like to use pessimitic...
5
by: campbellbrian2001 | last post by:
I'm trying to get the "Carry data over to new record" code to work from Allen Browne's site: http://allenbrowne.com/ser-24.html I follwed the instruction explicitly and somethings not working......
27
by: Kim Webb | last post by:
I have a field on a form for project number. I basically want it to be the next available number (ie 06010 then 06011 etc). In the form I create a text box and under control source I put: =!=...
6
by: kaosyeti | last post by:
hey.... i have a duplicate record issue i could use some help with. on a form that has 2 unbound controls, txtboxyear and cboxmonth, together will automatically fill in an invisible txtboxdate...
3
prn
by: prn | last post by:
Hi folks, I've got something that's driving me crazy here. If you don't want to read a long explanation, this is not the post for you. My problematic Access app is a DB for keeping track of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.