473,397 Members | 2,077 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,397 software developers and data experts.

Can setfocus on a field error 2108

SDL
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 read the
file and didn't find it.

If INVOICE_NBR1 = 0 Then
MsgBox "INVOICE NUMBER is not on file. Re-enter or enter NAME or
PHONE.",vbOKOnly
Me.INV_NBR.SetFocus

Any help would be great thanks.

Jul 16 '06 #1
1 8377
SDL wrote:
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 read the
file and didn't find it.

If INVOICE_NBR1 = 0 Then
MsgBox "INVOICE NUMBER is not on file. Re-enter or enter NAME or
PHONE.",vbOKOnly
Me.INV_NBR.SetFocus

Any help would be great thanks.
Use BeforeUpdate for your validation code and just set Cancel=True if it fails.
The control will never lose focus so resetting it is not required.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jul 16 '06 #2

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

Similar topics

4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
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...
3
by: Jim Devenish | last post by:
In my application vehicles arrive and depart from a workshop. The ArrivalDate and the HandoverDate are each entered. Sometimes the person who should enter the arrival date forgets to do so. ...
1
by: fonzie | last post by:
I a form with tab control will all fields based on one table. I have some code setup for the 'On Change' event of the tab control that checks to see if a field on the main form is null. If it is,...
0
by: srinivasarao yarru | last post by:
hi sir, in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse...
3
by: srinivasarao yarru | last post by:
hi in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse to same field...
5
agroover
by: agroover | last post by:
I can't seem to figure out how to get rid of the errors. I recieve the following error when I leave the Grade.SetFocus in my code... Microsoft Access can't move the focus to the control Grade ...
1
by: jvborg | last post by:
I am experiencing a problem when trying to move the setfocus to text field txtSearchDump, if i do not place the text into this field the query which i am initially trying to run does not execute. Any...
11
by: Veeves | last post by:
I have an unbound field on a form. In the onClick event I have code to populate a text field. I first setFocus to it and enable it. Both of these actions work. But when my code reaches the the line...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.