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

Access 97: Use VBA to find selected column in subform (datasheet view)

I have a form with a subform in datasheet view. Now, I want to trigger a
procedure (P1) each time the user selects an entire column (by clicking in
the heading) in the subform. The procedure (P1) I want to trigger needs to
be called with the selected column as a parameter.

As far as I am aware, there is no event procedure for clicking in the
heading of a datasheet. So insted I need to start by having an other
procedure P0, which is triggered in an other maner (maybe from timer, mouse
move or?). And then I can let P0 test if a column is selected or not. And
then if a solumn is selected, P0 should fin a name (or some other reference)
for the selected column, and the call my procedure P1.

Now, I have no idea how to read from VBA if a column is selected, and also I
have no idea how to find a reference to the selected column. Any ideas?

Thanks in advance

Thomas Zimmermann
Nov 16 '05 #1
1 6939
I'll admit I tried this in Access 2000, but I *think* it would work in A97
as well.

Clicking in a datasheet subform's header seems to trigger the OnClick event.
And in that event Screen.ActiveControl.Name returns the name of the column
you clicked on.

HTH

"Thomas Zimmermann" <thomas@zinformatik> wrote in message
news:43***********************@news.sunsite.dk...
I have a form with a subform in datasheet view. Now, I want to trigger a
procedure (P1) each time the user selects an entire column (by clicking in
the heading) in the subform. The procedure (P1) I want to trigger needs to
be called with the selected column as a parameter.

As far as I am aware, there is no event procedure for clicking in the
heading of a datasheet. So insted I need to start by having an other
procedure P0, which is triggered in an other maner (maybe from timer, mouse move or?). And then I can let P0 test if a column is selected or not. And
then if a solumn is selected, P0 should fin a name (or some other reference) for the selected column, and the call my procedure P1.

Now, I have no idea how to read from VBA if a column is selected, and also I have no idea how to find a reference to the selected column. Any ideas?

Thanks in advance

Thomas Zimmermann

Nov 17 '05 #2

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

Similar topics

2
by: MVM | last post by:
I am working in an Access project (.adp). I have a subform that displays the data in datasheet view. When I am logged onto a computer (Win 2000) with my username, the datasheet has the correct...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
39
by: Marcin Zmyslowski | last post by:
Hello all! I have the following problem with MS Access 2003 permissions. I have two users. One is admin and the second one is user who has full permissions to enter modify and read data. I...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
4
by: Don Do | last post by:
Help I built a form/subform/subsubform setup using the access forms wizard. I have a table1 = parent, table2 = child, table3 = (grandchild?). There will be multiple records in table2 that tie...
0
by: WPW07 | last post by:
Hello Everyone, I stumbled onto something interesting and was wondering if anyone else has experienced it and how they fixed it. I've posted to several forums to no avail. I've got a...
0
by: magickarle | last post by:
Hi to all. Little introduction on what I'm trying to do: I'm in charge of creating an access database for our supervisor where they can grade their agents. Per ex: agents are talking to customers...
5
by: Deano | last post by:
I have five subforms each living in a page on a tab control. Each form is in datasheet view. The time has come to resize both the forms and the subforms. I am able to change the column widths...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.