Hello Debbie,
Glad to hear the issue is resolved!
Thanks & Regards,
Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support
Get Secure! -
www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "DebbieG" <
[email protected]>
| References: <#
[email protected]>
<
[email protected]>
<#UW#
[email protected]>
<
[email protected]>
<
[email protected]>
<qgCpeU#
[email protected]>
<Ov1FNq#
[email protected]>
<
[email protected]>
| Subject: Re: MouseWheel in Continuous Forms
| Date: Fri, 17 Dec 2004 01:55:02 -0600
| Lines: 434
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.access.formscoding
| NNTP-Posting-Host: t1p015.stmo2.socket.net 64.85.214.17
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:255690
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I am smiling!!!!! That works exactly as I wanted. I really appreciate
your
| help.
|
| Thank you,
| Debbie
|
|
| | | Hello Debbie,
| |
| | Thank you for your reply. You could record the current control name by
| | using Enter event of each control if necessary. The following is a
sample
| |
| | Dim CurrentCtrlName As String
| |
| | Private Sub Control1_Enter()
| | CurrentCtrlName = "Control1"
| | End Sub
| |
| | Private Sub cmdClose_Click()
| | If Me.Dirty Then
| | CompleteMsg
| | Dim recordnum As Long
| | recordnum = Me.CurrentRecord
| | DoCmd.GoToControl CurrentCtrlName
| | DoCmd.GoToRecord , "", acGoTo, recordnum
| | Exit Sub
| | End If
| | End Sub
| |
| | Have a great day!
| |
| | Thanks & Regards,
| |
| | Peter Yang
| | MCSE2000, MCSA, MCDBA
| | Microsoft Partner Online Support
| |
| | Get Secure! -
www.microsoft.com/security
| |
| | =====================================================
| | When responding to posts, please "Reply to Group" via
| | your newsreader so that others may learn and benefit
| | from your issue.
| | =====================================================
| | This posting is provided "AS IS" with no warranties, and confers no
| rights.
| |
| |
| | --------------------
| || From: "DebbieG" <
[email protected]>
| || References: <#
[email protected]>
| | <
[email protected]>
| | <#UW#
[email protected]>
| | <
[email protected]>
| | <
[email protected]>
| | <qgCpeU#
[email protected]>
| || Subject: Re: MouseWheel in Continuous Forms
| || Date: Thu, 16 Dec 2004 21:44:18 -0600
| || Lines: 331
| || X-Priority: 3
| || X-MSMail-Priority: Normal
| || X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| || X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| || Message-ID: <Ov1FNq#
[email protected]>
| || Newsgroups: microsoft.public.access.formscoding
| || NNTP-Posting-Host: t1p015.stmo2.socket.net 64.85.214.17
| || Path:
| |
|
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
| | phx.gbl
| || Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:255677
| || X-Tomcat-NG: microsoft.public.access.formscoding
| ||
| || Thanks for sticking with me.
| || Would you please be specific in how to code it and where to place the
| | code.
| ||
| || Thanks,
| || Debbie
| ||
| || | || | Hello Debbie,
| || |
| || | I think you may want to consider using a global varaible
currentcontrol
| | to
| || | trace the focus of the current control so that you could get back to
it
| || | when necessary.
| || |
| || | Regards,
| || |
| || | Peter Yang
| || | MCSE2000, MCSA, MCDBA
| || | Microsoft Partner Online Support
| || |
| || | Get Secure! -
www.microsoft.com/security
| || |
| || | =====================================================
| || | When responding to posts, please "Reply to Group" via
| || | your newsreader so that others may learn and benefit
| || | from your issue.
| || | =====================================================
| || | This posting is provided "AS IS" with no warranties, and confers no
| || rights.
| || |
| || |
| || | --------------------
| || || From: "DebbieG" <
[email protected]>
| || || References: <#
[email protected]>
| || | <
[email protected]>
| || | <#UW#
[email protected]>
| || | <
[email protected]>
| || || Subject: Re: MouseWheel in Continuous Forms
| || || Date: Thu, 16 Dec 2004 10:34:55 -0600
| || || Lines: 255
| || || X-Priority: 3
| || || X-MSMail-Priority: Normal
| || || X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| || || X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| || || Message-ID: <
[email protected]>
| || || Newsgroups: microsoft.public.access.formscoding
| || || NNTP-Posting-Host: t1p387.stmo2.socket.net 64.85.215.133
| || || Path:
| || |
| ||
| |
|
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
| || | phx.gbl
| || || Xref: cpmsftngxa10.phx.gbl
microsoft.public.access.formscoding:255614
| || || X-Tomcat-NG: microsoft.public.access.formscoding
| || ||
| || || When I click on cmdClose it knows what the current record is, it
just
| || || doesn't GoTo it.
| || ||
| || || I found if I GoTo a specific control and then GoTo the current
record,
| | it
| || || works but it goes to a specific field.
| || ||
| || || This goes to the current record and to a specific control:
| || ||
| || || Private Sub cmdClose_Click()
| || || If Me.Dirty Then
| || || CompleteMsg
| || || Dim recordnum As Long
| || || recordnum = Me.CurrentRecord
| || || DoCmd.GoToControl "DrugScreenCD_combo"
| || || DoCmd.GoToRecord , "", acGoTo, recordnum
| || || Exit Sub
| || || End If
| || || End Sub
| || ||
| || || This does nothing:
| || ||
| || || Private Sub cmdClose_Click()
| || || If Me.Dirty Then
| || || CompleteMsg
| || || Dim recordnum As Long
| || || recordnum = Me.CurrentRecord
| || || ' DoCmd.GoToControl "DrugScreenCD_combo"
| || || DoCmd.GoToRecord , "", acGoTo, recordnum
| || || Exit Sub
| || || End If
| || || End Sub
| || ||
| || || Is there a way to know which control was active before I clicked on
| || | cmdClose
| || || and go to it during cmdCose_Click? If this requires a Global
| variable,
| || || please be specific in how to code it and where to place the code.
| || ||
| || || Debbie
| || ||
| || ||
| || || | || || | Hello Debbie,
| || || |
| || || | This occurs because Me.CurrentRecord is updated when the command
| | click
| || || | event occurs.
| || || |
| || || | I suggest that you define a global variable PreRecordnum, and let
it
| || | equal
| || || | to Me.CurrentRecord whenever it is changed in your own code
| || || | (orm_BeforeUpdate, Form_KeyDown for PageUp and PageDown). You can
| use
| || | the
| || || | following code to go back to previous record in cmdClose button.
| || || |
| || || | DoCmd.GoToRecord , , acGoTo, PreRecordnum
| || || |
| || || | Hope this information is helpful.
| || || |
| || || | Peter Yang
| || || | MCSE2000, MCSA, MCDBA
| || || | Microsoft Partner Online Support
| || || |
| || || | Get Secure! -
www.microsoft.com/security
| || || |
| || || | =====================================================
| || || | When responding to posts, please "Reply to Group" via
| || || | your newsreader so that others may learn and benefit
| || || | from your issue.
| || || | =====================================================
| || || | This posting is provided "AS IS" with no warranties, and confers
no
| || || rights.
| || || |
| || || |
| || || | --------------------
| || || || From: "DebbieG" <
[email protected]>
| || || || References: <#
[email protected]>
| || || | <
[email protected]>
| || || || Subject: Re: MouseWheel in Continuous Forms
| || || || Date: Wed, 15 Dec 2004 03:38:42 -0600
| || || || Lines: 150
| || || || X-Priority: 3
| || || || X-MSMail-Priority: Normal
| || || || X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| || || || X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| || || || Message-ID: <#UW#
[email protected]>
| || || || Newsgroups: microsoft.public.access.formscoding
| || || || NNTP-Posting-Host: t1p203.stmo2.socket.net 64.85.214.205
| || || || Path:
| || || |
| || ||
| || |
| ||
| |
|
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
| || || | phx.gbl
| || || || Xref: cpmsftngxa10.phx.gbl
| | microsoft.public.access.formscoding:255475
| || || || X-Tomcat-NG: microsoft.public.access.formscoding
| || || ||
| || || || I'm partially successful. I added the following code to
| || || | Form_BeforeUpdate,
| || || || Form_KeyDown (for PageUp and PageDown), and on my cmdClose
button:
| || || ||
| || || || If Me.Dirty Then
| || || || CompleteMsg - a standard message that user must
complete
| || the
| || || || edited record
| || || || Dim recordnum As Long
| || || || recordnum = Me.CurrentRecord
| || || || DoCmd.GoToRecord , , acGoTo, recordnum
| || || || Exit Sub
| || || || End If
| || || ||
| || || || If I use the MouseWheel and click on another record, or use the
| | PageUp
| || | or
| || || || PageDown key it goes to the edited record. GREAT! However, if I
| || click
| || || | on
| || || || the cmdClose button the screen doesn't move to the edited record.
| || I've
| || || || tried using Me.RecordsetClone.AbsolutePosition +1 and
| || || | Me.RecordsetClone.Move
| || || || Me.SelTop and recordnum = me.SelTop and bookmark and still it
| | doesn't
| || || | move
| || || || to the edited record.
| || || ||
| || || || What in the world am I missing?
| || || ||
| || || || Debbie
| || || ||
| || || ||
message
| || || || | || || || | Hello Debbie,
| || || || |
| || || || | Form has a bookmark property that might help. Also, you can use
| || || || | RecordsetClone of the form to get more flexibility. I have
| | included
| || | the
| || || || | following article for your reference:
| || || || |
| || || || | 128883 ACC2: How to Get "X of Y" from Record Navigation Buttons
| || || || |
http://support.microsoft.com/?id=128883
| || || || |
| || || || | 294202 How to enumerate selected form records in Access 2002
| || || || |
http://support.microsoft.com/?id=294202
| || || || |
| || || || | Hope this helps.
| || || || |
| || || || | Peter Yang
| || || || | MCSE2000, MCSA, MCDBA
| || || || | Microsoft Partner Online Support
| || || || |
| || || || | Get Secure! -
www.microsoft.com/security
| || || || |
| || || || | =====================================================
| || || || | When responding to posts, please "Reply to Group" via
| || || || | your newsreader so that others may learn and benefit
| || || || | from your issue.
| || || || | =====================================================
| || || || | This posting is provided "AS IS" with no warranties, and
confers
| | no
| || || || rights.
| || || || |
| || || || |
| || || || | --------------------
| || || || || From: "DebbieG" <
[email protected]>
| || || || || Subject: MouseWheel in Continuous Forms
| || || || || Date: Tue, 14 Dec 2004 16:08:43 -0600
| || || || || Lines: 67
| || || || || X-Priority: 3
| || || || || X-MSMail-Priority: Normal
| || || || || X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| || || || || X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| || || || || Message-ID: <#
[email protected]>
| || || || || Newsgroups: microsoft.public.access.formscoding
| || || || || NNTP-Posting-Host: t2p744.stmo2.socket.net 64.85.218.237
| || || || || Path:
| || || || |
| || || ||
| || || |
| || ||
| || |
| ||
| |
|
cpmsftngxa10.phx.gbl!TK2MSFTNGXA06.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
| || || || | phx.gbl!TK2MSFTNGP09.phx.gbl
| || || || || Xref: cpmsftngxa10.phx.gbl
| || | microsoft.public.access.formscoding:255436
| || || || || X-Tomcat-NG: microsoft.public.access.formscoding
| || || || ||
| || || || || I am using the following code to prevent use of the MouseWheel
| | when
| || || || | editing
| || || || || records:
| || || || ||
| || || || || There is a textbox on my form called UnboundTextBox.
| || || || ||
| || || || || Private mWheel As Boolean
| || || || || Private validationTrigger As wsTrigger
| || || || ||
| || || || || Private Enum wsTrigger
| || || || || MyWheel = 1
| || || || || NotTheWheel = 2
| || || || || End Enum
| || || || ||
| || || || || Private Function WheelSpin() As Integer
| || || || || WheelSpin = mWheel
| || || || || Select Case validationTrigger
| || || || || Case NotTheWheel
| || || || || mWheel = False
| || || || || End Select
| || || || || End Function
| || || || ||
| || || || || Private Sub Form_Error(DataErr As Integer, Response As
Integer)
| || || || || If Screen.ActiveControl.Name = "UnboundTextBox" Then
| || || || || Response = acDataErrContinue
| || || || || End If
| || || || || End Sub
| || || || ||
| || || || || Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal
Count
| As
| || || Long)
| || || || || On Error GoTo GotError
| || || || || If Me.Dirty Then
| || || || || mWheel = True
| || || || || validationTrigger = MyWheel
| || || || || Me.UnboundTextBox.SetFocus
| || || || || Me.UnboundTextBox.Text = " "
| || || || || End If
| || || || ||
| || || || || ExitSub:
| || || || || validationTrigger = NotTheWheel
| || || || || Exit Sub
| || || || ||
| || || || || GotError:
| || || || || If Err.Number = 2107 Then
| || || || || CompleteMsg 'a standard message that they must
| | complete
| || | the
| || || || | edit
| || || || || Resume ExitSub
| || || || || End If
| || || || || MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf &
| || || || || "Form_MouseWheel"
| || || || || Resume ExitSub
| || || || || End Sub
| || || || ||
| || || || || This works great on single forms. This makes sense because
| || | basically
| || || | the
| || || || || MouseWheel is similar to PageUp and PageDown.
| || || || ||
| || || || || However, when editing on continuous forms, it ALLOWS the
scroll
| | and
| || | if
| || || || | the
| || || || || user clicks on another record, they get the "CompleteMsg" from
| || || || || Form_BeforeUpdate which is great ... but how can I make it
| scroll
| || | back
| || || | to
| || || || || the edited record so they don't have to scroll to find it. I
| | don't
| || || | want
| || || || | to
| || || || || turn off the MouseWheel completely because that is handy in
the
| || || || | continuous
| || || || || forms.
| || || || ||
| || || || || Is there a way to bookmark the edited record or a way to not
| | allow
| || | the
| || || || || MouseWheel if editing on a continuous form?
| || || || ||
| || || || || Thanks,
| || || || || Debbie
| || || || ||
| || || || ||
| || || || ||
| || || || |
| || || ||
| || || ||
| || || ||
| || || |
| || ||
| || ||
| || ||
| || |
| ||
| ||
| ||
| |
|
|
|