PC Review


Reply
Thread Tools Rate Thread

DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70

 
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      2nd Mar 2006
My form has an event procedure in the beforeUpdate as seen below... I have a
combobox on the same main form that has afterUpdate event. the thing is that
when I select the AcctDescrAvailable combox to select Yes/No, I have popup
that says select an account name which comes from the form's beforeupdate
procedure. So I press ok then then the runtime error 2501, the Domenuitem
action was cancelled.
If ypu press debug it points to the
DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70
Which is in the afterupdate procedure of that combobox ...

Any Help with this would be highly appreaciated....

***************beforeUpdate Procedure******************
If Me!AcctDecision.Column(1) = "Pending" Then
Debug.Print "Pending"
If IsNull(Me!AcctCode) Then
Debug.Print "AcctCode is null. Cancelling."
Cancel = True
strControl = strControl & "Select an Account Name" & vbCrLf
End If
End If
******************************************************

********************************************************
Private Sub AcctDescrAvailable_AfterUpdate()
Dim strARG As String
Dim strSQL As String
Dim DocName As String
Dim LinkCriteria As String
Dim Response As Integer
Dim Cancel As Boolean

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

If AcctDescrAvailable.Value = "No" Then
strARG = _
"Account Information, SELECT MailAddressLine1 as
AcctAddrLine1,MailAddressLine2 as AcctAddrLine2, propCity as AcctCity,
MailState as AcctState,MailZipCode as AcctZipCode FROM tblAcctInfor where
[AcctID] = " & AcctID & ";"
DocName = "frmAcctDescInput"
DoCmd.OpenForm DocName, , , LinkCriteria, , , strARG
Else
strSQL = "UPDATE tblAcctInfor SET MailAddressLine1, MailAddressLine2,
MailCity, MailState, MailZipCode= null where [AcctID] =" & AcctID & ";"
CurrentDb.Execute strSQL
End If

End Sub
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hyaXMgQnVybmV0dGU=?=
Guest
Posts: n/a
 
      2nd Mar 2006
Sorry, but I'm not sure I quite understand exactly what you're trying to do
here. It looks like you're trying to paste something somewhere after you
update your 'AcctDescrAvailable' combobox.

However, I'm not quite sure it is what you're trying to paste, since I don't
see your code cutting or copying any data. My guess is that Access is giving
you an error message since it simply doesn't know what you're trying to
paste. I would recommend checking the clipboard to see whether or not
there's any data there.

If you can explain clearly what you're trying to do with this code, I may be
able to be of more help to you.

-Chris

"JOM" wrote:

> My form has an event procedure in the beforeUpdate as seen below... I have a
> combobox on the same main form that has afterUpdate event. the thing is that
> when I select the AcctDescrAvailable combox to select Yes/No, I have popup
> that says select an account name which comes from the form's beforeupdate
> procedure. So I press ok then then the runtime error 2501, the Domenuitem
> action was cancelled.
> If ypu press debug it points to the
> DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70
> Which is in the afterupdate procedure of that combobox ...
>
> Any Help with this would be highly appreaciated....
>
> ***************beforeUpdate Procedure******************
> If Me!AcctDecision.Column(1) = "Pending" Then
> Debug.Print "Pending"
> If IsNull(Me!AcctCode) Then
> Debug.Print "AcctCode is null. Cancelling."
> Cancel = True
> strControl = strControl & "Select an Account Name" & vbCrLf
> End If
> End If
> ******************************************************
>
> ********************************************************
> Private Sub AcctDescrAvailable_AfterUpdate()
> Dim strARG As String
> Dim strSQL As String
> Dim DocName As String
> Dim LinkCriteria As String
> Dim Response As Integer
> Dim Cancel As Boolean
>
> DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
>
> If AcctDescrAvailable.Value = "No" Then
> strARG = _
> "Account Information, SELECT MailAddressLine1 as
> AcctAddrLine1,MailAddressLine2 as AcctAddrLine2, propCity as AcctCity,
> MailState as AcctState,MailZipCode as AcctZipCode FROM tblAcctInfor where
> [AcctID] = " & AcctID & ";"
> DocName = "frmAcctDescInput"
> DoCmd.OpenForm DocName, , , LinkCriteria, , , strARG
> Else
> strSQL = "UPDATE tblAcctInfor SET MailAddressLine1, MailAddressLine2,
> MailCity, MailState, MailZipCode= null where [AcctID] =" & AcctID & ";"
> CurrentDb.Execute strSQL
> End If
>
> End Sub

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      2nd Mar 2006
Ok this is what happening, My form is used to enter some mortage Loan
application information. (source of this form is tblAcctInfor)
The combobox AcctDescrAvailable( which means is the account description
address available) has values Yes, No, and Unknown. If a user selects no then
a popup box(frmAcctDescInput) pops up for the user to enter the loan address
information and when it closes the information in table tblAcctInfor is
updated.

tblAcctInfor has the Applicants address information the mortgage Loan
address information, AcctDescrAvailable, AcctDecision among other fields.

using the idea that I found in the following website
http://www.rogersaccesslibrary.com/d...herProblem.mdb


"Chris Burnette" wrote:

> Sorry, but I'm not sure I quite understand exactly what you're trying to do
> here. It looks like you're trying to paste something somewhere after you
> update your 'AcctDescrAvailable' combobox.
>
> However, I'm not quite sure it is what you're trying to paste, since I don't
> see your code cutting or copying any data. My guess is that Access is giving
> you an error message since it simply doesn't know what you're trying to
> paste. I would recommend checking the clipboard to see whether or not
> there's any data there.
>
> If you can explain clearly what you're trying to do with this code, I may be
> able to be of more help to you.
>
> -Chris
>
> "JOM" wrote:
>
> > My form has an event procedure in the beforeUpdate as seen below... I have a
> > combobox on the same main form that has afterUpdate event. the thing is that
> > when I select the AcctDescrAvailable combox to select Yes/No, I have popup
> > that says select an account name which comes from the form's beforeupdate
> > procedure. So I press ok then then the runtime error 2501, the Domenuitem
> > action was cancelled.
> > If ypu press debug it points to the
> > DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70
> > Which is in the afterupdate procedure of that combobox ...
> >
> > Any Help with this would be highly appreaciated....
> >
> > ***************beforeUpdate Procedure******************
> > If Me!AcctDecision.Column(1) = "Pending" Then
> > Debug.Print "Pending"
> > If IsNull(Me!AcctCode) Then
> > Debug.Print "AcctCode is null. Cancelling."
> > Cancel = True
> > strControl = strControl & "Select an Account Name" & vbCrLf
> > End If
> > End If
> > ******************************************************
> >
> > ********************************************************
> > Private Sub AcctDescrAvailable_AfterUpdate()
> > Dim strARG As String
> > Dim strSQL As String
> > Dim DocName As String
> > Dim LinkCriteria As String
> > Dim Response As Integer
> > Dim Cancel As Boolean
> >
> > DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
> >
> > If AcctDescrAvailable.Value = "No" Then
> > strARG = _
> > "Account Information, SELECT MailAddressLine1 as
> > AcctAddrLine1,MailAddressLine2 as AcctAddrLine2, propCity as AcctCity,
> > MailState as AcctState,MailZipCode as AcctZipCode FROM tblAcctInfor where
> > [AcctID] = " & AcctID & ";"
> > DocName = "frmAcctDescInput"
> > DoCmd.OpenForm DocName, , , LinkCriteria, , , strARG
> > Else
> > strSQL = "UPDATE tblAcctInfor SET MailAddressLine1, MailAddressLine2,
> > MailCity, MailState, MailZipCode= null where [AcctID] =" & AcctID & ";"
> > CurrentDb.Execute strSQL
> > End If
> >
> > End Sub

 
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
acMenuVer70 commands help Teresa Thomas via AccessMonster.com Microsoft Access VBA Modules 4 1st Apr 2009 03:51 PM
acMenuVer70 Ruth Microsoft Access Form Coding 5 28th Mar 2008 05:37 PM
ACMenuver70 - Need to Save Name Choosen from "Applicable Filter" Box Walkabout Microsoft Access Form Coding 0 24th Jan 2007 08:59 PM
Search only current using DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 Vic Spainhower Microsoft Access 2 8th Jun 2005 02:56 PM
error caused by If Dirty Then DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Jason Microsoft Access Form Coding 5 18th Mar 2004 12:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:15 AM.