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

error 2108 in beforeupdate event

Hi,
I have a beforeupdate evbent that tests to see that a customer chosen
before the user can enter an amount. If the customer has not been
chosen yet, then I would like to popup a message informing the user to
first choose a customer. After the user has clicked on OK, I want the
code to undo the amount field and set focus to a field in a subform
where the user can then type in a customer nasme. Using the code below,
I get the 2108 error. Here is part of the code in the Beforeupdate
event:

'Verify that an account has been choosen
If Me.iAccountID < 1 Then
sMsg = "You must first choose an account/customer before entering an
amount"
MsgBox sMsg, vbOKOnly
Cancel = True
SendKeys "{ESC}", True
SendKeys "{ESC}", True
Me.cServiceAmount.Undo
Me.WorkOrderEditSFService.SetFocus
Me!WorkOrderEditSFService.Form!fsContact.SetFocus
Exit Sub
End If

I get th error on the first setfocus statement. As you can see I've
tried using both the undo command and the sendkeys event. I've tried
all combinations of these statements but still get the error 2108 each
time.

Thanks for any help in advance,
Adolph

Mar 21 '06 #1
0 1749

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

Similar topics

4
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a form with multiple pages on it. There is one text field on the third page of the form that I need the user to complete before leaving the form or moving...
1
by: DD | last post by:
If user enters chooseCustomer and Me.choosePaymentReceipt is null then Me.choosePaymentReceipt.SetFocus the error is on Me.choosePaymentReceipt.SetFocus. this is an unbound Combobox Row Source...
2
by: Bob Darlington | last post by:
When a user clears a value from a combo box (by pressing the delete key), the following message appears: "You tried to assign the null value to a variable that is not a variant data type". ...
2
by: PC Datasheet | last post by:
In a form/subform I have an unbound combobox in the form header that sets the value of a field in the subform so that it does not have to be entered for each record. In the BeforeUpdate event of...
7
by: | last post by:
Hi all, I have a simple .aspx page running on net 2.0 that is trying to do a http post to a remote server. Here is the code Private Function ProcessRequests(ByVal strbody As String) As String...
1
by: SDL | last post by:
The code below says error 2108 must save field before setfocus? All I want to do is check out the input field and if in error set the cursor back on it after the MsgBox displays. In this case I...
2
by: Scott | last post by:
I have a BeforeUpdate Event Procedure as below and got an error message. BeforeUpdate Event Procedure If IsNull() Then = Now() Else = Now() End If
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
2
by: PW | last post by:
Hi, What the heck is that supposed to mean? I am getting this error on a "Me.Requery" line in a subroutine on a form, but only when I select something from a combo/dropdown box. The *exact*...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.