PC Review


Reply
Thread Tools Rate Thread

Disable Double Click

 
 
Bob V
Guest
Posts: n/a
 
      8th Dec 2007

My form opens in 2 different arguments
If Me.OpenArgs = "ModifyOldInvoice" Then
If Me.OpenArgs = "HoldingInvoice" Then

Can I disable the double click in "ModifyOldInvoice"
because it works on "HoldingInvoice" Only and is giving me a Error on
"ModifyOldInvoice"

My Double click Code:
Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"

stLinkCriteria = "[ChargeNumber]=" & Me![tbChargeNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Thanks for any help..Bob


 
Reply With Quote
 
 
 
 
Bob V
Guest
Posts: n/a
 
      8th Dec 2007
Added this to my code now it seems to work is this what they mean by
catching an error???...Bob
On Error Resume Next

If Err.Number = 3075 Then
MsgBox "This application has detected newer versions " _
& "of required files on your computer. " _
& "It may take several minutes to recompile " _
& "this application."
Err.Clear
End If
"Bob V" <(E-Mail Removed)> wrote in message
news:%23UFpI%(E-Mail Removed)...
>
> My form opens in 2 different arguments
> If Me.OpenArgs = "ModifyOldInvoice" Then
> If Me.OpenArgs = "HoldingInvoice" Then
>
> Can I disable the double click in "ModifyOldInvoice"
> because it works on "HoldingInvoice" Only and is giving me a Error on
> "ModifyOldInvoice"
>
> My Double click Code:
> Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
> Dim stDocName As String
> Dim stLinkCriteria As String
> stDocName = "frmAdditionalCharges"
>
> stLinkCriteria = "[ChargeNumber]=" & Me![tbChargeNumber]
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> End Sub
> Thanks for any help..Bob
>
>



 
Reply With Quote
 
Tom Wickerath
Guest
Posts: n/a
 
      9th Dec 2007
Hi Bob,

> is this what they mean by catching an error???...
> On Error Resume Next


No. That's an example of ignoring an error.
_____________________

> If Err.Number = 3075 Then


Yes, this is an example of doing something conditional on error 3075.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"Bob V" wrote:

> Added this to my code now it seems to work is this what they mean by
> catching an error???...Bob
> On Error Resume Next
>
> If Err.Number = 3075 Then
> MsgBox "This application has detected newer versions " _
> & "of required files on your computer. " _
> & "It may take several minutes to recompile " _
> & "this application."
> Err.Clear
> End If

 
Reply With Quote
 
Tom Wickerath
Guest
Posts: n/a
 
      9th Dec 2007
Hi Bob,

Try this modification:

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)

If Me.OpenArgs = "HoldingInvoice" Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"

stLinkCriteria = "[ChargeNumber]=" & Me![tbChargeNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub

Here is an alternate form, that eliminates the stDocName and stLinkCriteria
variables (these are really not needed), uses named arguments with the :=
(colon equal), eliminating the need for positional arguments, and adds error
handling, since pretty much all procedures should include error handling:

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
On Error GoTo ProcError

If Me.OpenArgs = "HoldingInvoice" Then
DoCmd.openForm FormName:="frmAdditionalCharges", _
WhereCondition:="[ChargeNumber]=" & Me![tbChargeNumber]
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure tbAdditionCharge_DblClick..."
Resume ExitProc
End Sub


You can also use a SELECT Case....END SELECT construct, as in this example:

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
On Error GoTo ProcError

Select Case Me.OpenArgs
Case "HoldingInvoice"
DoCmd.openForm FormName:="frmAdditionalCharges", _
WhereCondition:="[ChargeNumber]=" & Me![tbChargeNumber]
Case "ModifyOldInvoice"
MsgBox "This action is not available with old invoices.", _
vbInformation, "Disabled DoubleClick"
Case Else
'Enter some default action if the form can be opened
'without an openarg argument
End Select

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure tbAdditionCharge_DblClick..."
Resume ExitProc
End Sub


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"Bob V" wrote:

>
> My form opens in 2 different arguments
> If Me.OpenArgs = "ModifyOldInvoice" Then
> If Me.OpenArgs = "HoldingInvoice" Then
>
> Can I disable the double click in "ModifyOldInvoice"
> because it works on "HoldingInvoice" Only and is giving me a Error on
> "ModifyOldInvoice"
>
> My Double click Code:
> Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
> Dim stDocName As String
> Dim stLinkCriteria As String
> stDocName = "frmAdditionalCharges"
>
> stLinkCriteria = "[ChargeNumber]=" & Me![tbChargeNumber]
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> End Sub
> Thanks for any help..Bob

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable Double click amt2008 Windows XP Security 2 5th Oct 2009 04:43 AM
Re: How to disable mouse pad double-click Jdeezy Windows XP Hardware 0 17th Mar 2007 06:05 PM
disable double-click Brian Cahill Microsoft Windows 2000 Registry 2 18th Aug 2006 11:34 PM
disable double-click Brian Cahill Microsoft Windows 2000 Registry Archive 1 23rd Feb 2005 01:46 AM
Disable double Click on startmenu =?Utf-8?B?R2FyZXRoX0I=?= Windows XP Security 0 10th Nov 2004 10:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 AM.