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

Changing the current record when using continuous forms

aaj
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is with
a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and
then clicks on a label in record 2 hoping to update the contents of record
2, record 1 still has the focus and so its hs_comments box is updated rather
than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the
focus before the comments box is updated. I have tried using double click
and doevents but to no avail

any help would be most welcome

Thanks in advance

Andy
Nov 12 '05 #1
2 12494
TC
Well described.

I don't have Access here to check, but I think you'll find this tough to fix
if you keep using labels.

A label can be clicked (obviously), but it does not >accept the focus<, so
the focus remains on whatever record it was on before.You need the label's
click event to move the focus to the correct new record. You can move the
focus to any record using Recordstclone, bookmarks & Selheight. But the
problem is, knowing >which record< to move it to! The label's click event
just >does not know< which record was clicked.

I can think of a few very ugly ways around this. But it would be easier to
change the labels to a control that does accept the focus: eg. a textbox.
Then, when the user clicks the text in that box, the focus will move to that
record, & everything will work ok. You could perhaps even code a MouseMove
event for the textbox, to change the cursor from the vertical text-entry bar
(which is normally displayed for a textbox), back to the normall arrow, so
it looked just like the labels did.

HTH,
TC
"aaj" <a.*@c.com> wrote in message
news:3f***********************@news.easynet.co.uk. ..
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is with a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and
then clicks on a label in record 2 hoping to update the contents of record 2, record 1 still has the focus and so its hs_comments box is updated rather than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the
focus before the comments box is updated. I have tried using double click
and doevents but to no avail

any help would be most welcome

Thanks in advance

Andy

Nov 12 '05 #2
aaj
That sounds like an excellent suggestion...nice lateral thought 8-)

many thanks

Andy

"TC" <a@b.c.d> wrote in message news:1069127711.695655@teuthos...
Well described.

I don't have Access here to check, but I think you'll find this tough to fix if you keep using labels.

A label can be clicked (obviously), but it does not >accept the focus<, so
the focus remains on whatever record it was on before.You need the label's
click event to move the focus to the correct new record. You can move the
focus to any record using Recordstclone, bookmarks & Selheight. But the
problem is, knowing >which record< to move it to! The label's click event
just >does not know< which record was clicked.

I can think of a few very ugly ways around this. But it would be easier to
change the labels to a control that does accept the focus: eg. a textbox.
Then, when the user clicks the text in that box, the focus will move to that record, & everything will work ok. You could perhaps even code a MouseMove
event for the textbox, to change the cursor from the vertical text-entry bar (which is normally displayed for a textbox), back to the normall arrow, so
it looked just like the labels did.

HTH,
TC
"aaj" <a.*@c.com> wrote in message
news:3f***********************@news.easynet.co.uk. ..
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is

with
a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and then clicks on a label in record 2 hoping to update the contents of

record
2, record 1 still has the focus and so its hs_comments box is updated

rather
than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the focus before the comments box is updated. I have tried using double click and doevents but to no avail

any help would be most welcome

Thanks in advance

Andy


Nov 12 '05 #3

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

Similar topics

4
by: Prakash Wadhwani | last post by:
I have 3 fields : First_Name, Last_Name & Policy_Number I'm using a continuous form. If I invoke conditional formatting on First_Name & set a condition of "Prakash" (change the foreground to...
4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
1
by: Richard Coutts | last post by:
I have a Continuous Form where each record has a button that activates another form that simplifies entering values into the record. The activated form has the equivalent of a "Done" button. I'd...
2
by: Melissa | last post by:
I have a single (not continuous) form with an Undo button for entering finished projects. On the form is also a subform that lists all finished projects for reference. When I enter the...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
4
by: Francis | last post by:
Hello i have a continuos form, and i have a command button to help insert information on a control textbox. But when the text box is not null, i dont want the command button to show (to the current...
2
by: Bob | last post by:
I got three related datagrid views one parent and two children of the same. The two child tables contain many thousands of records and some of the contents are bitmap files in a sql server...
5
by: eighthman11 | last post by:
Hi everyone: This is probably a pretty simple problem but it is driving me nuts. Using Access 2000. I have a continuous form which list several thousand inventory items. The user can enter a...
3
by: tombarth11 | last post by:
I have searched, but can't find a thread that addresses this problem. I think I'm just overlooking something simple, but I'm stumped at this time. My problem is that I need to provide a list of order...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.