Can't move to previous\next record

aziz rasul

Active member
Local time
Today, 00:12
Joined
Jun 26, 2000
Messages
1,935
I have a form called "frmGroups" with an assortment of combo\text boxes.

In 2 text boxes (Start Date of Course, Start Time of Course) and 1 combo box (Time Slot), if I have the mouse cursor in either of these controls, I can't move to another record? With the other remaining controls, no problems.

I have attached the db.

On the opening Splash screen, simply press the NHS logo to bring up the db window. From the Switchboard, select 'Groups' and press Go to open ""frmGroups.
 

Attachments

After looking at your code in the txtDateOfCourse On Enter Event...

Code:
Private Sub txtDateofCourse_Enter()
    Me.lblDay.Caption = Format(Me.txtDateofCourse, "dddd")
    Me.txtgroupname = Me.cbogroupproject.Column(1) & " - " & Me.cbovenueID.Column(1) & " " & Me.txtDateofCourse & " " & Me.lblDay.Caption & " " & Me.txtTimeofCourse
    Me.Requery
End Sub

and the code in the txtDateofCourse On Exit Event...
Code:
Private Sub txtDateofCourse_Exit(Cancel As Integer)
    Me.lblDay.Caption = Format(Me.txtDateofCourse, "dddd")
    Me.txtgroupname = Me.cbogroupproject.Column(1) & " - " & Me.cbovenueID.Column(1) & " " & Me.txtDateofCourse & " " & Me.lblDay.Caption & " " & Me.txtTimeofCourse
    Me.Requery
End Sub

... I realized that you are changing values in the Record Source data everytime you enter and exit this control and the other two (2) controls you are having a problem with. (Notice the pencil Icon on the Record Selector. This means that Access is busy writing changes to your record). Access is not allowing you to page to the previous or next record because you are not completing the saving of the changed data. I personally would not change the data everytime I enter or exit the control, BUT I have found the following to work fine for you.

Change the enter and exit code for the three (3) controls you are having a problem with.

Delete the Me.Requery command and in it's place use...

Code:
Private Sub txtDateofCourse_Exit(Cancel As Integer)
    Me.lblDay.Caption = Format(Me.txtDateofCourse, "dddd")
    Me.txtgroupname = Me.cbogroupproject.Column(1) & " - " & Me.cbovenueID.Column(1) & " " & Me.txtDateofCourse & " " & Me.lblDay.Caption & " " & Me.txtTimeofCourse
    [COLOR=red]DoCmd.RunCommand acCmdSaveRecord 'Use this command in all 3 controls Enter and Exit Events[/COLOR]
 
End Sub


You will be saving the record everytime you enter and exit the three controls you are having a problem with. If this is what you want to do, then by all means do it to it!

With this "FIX" you can page to the previous and next records without a problem.

Hope this helps you with your problem.


Richard
 
Last edited:
Many thanks.
 
Many Welcomes!

:) Richard

Two cannibals are sitting by the camp fire when one cannibal says to the other...

"I can't stand my mother-in-law.

The second cannibal remarks.

"You think that's bad. You ought to try the potatoes."
 
Last edited:

Users who are viewing this thread

Back
Top Bottom