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

messge box for certain codes on data entry into a form

Staff have to enter data between A000 and Z999 into a field in an access form. I need a pop up box for any code between J000 and J999 stating that they need to check the authorisation for this item. T
Feb 19 '16 #1

✓ answered by jimatqsi

Pop up messages are really annoying. Okay if you must, but I would rather turn the box red or display something on the screen without requiring a click. Anyway, add some code to the After Update event of the field being entered. If the text is being entered into textbox Item_txt, then in the after update event put

Expand|Select|Wrap|Line Numbers
  1.     me.item_txt.backcolor=vbwhite
  2. if me.item_txt >= "J000" and me.item_txt <= "J999" then
  3.     msgbox "whatever"
  4.     me.item_txt.backcolor=vbred
  5. end
Of course you don't need to do both the red and the msgbox, choose what you like. And red is awfully harsh, I nearly never use plain red.

Jim

4 876
jimatqsi
1,271 Expert 1GB
Pop up messages are really annoying. Okay if you must, but I would rather turn the box red or display something on the screen without requiring a click. Anyway, add some code to the After Update event of the field being entered. If the text is being entered into textbox Item_txt, then in the after update event put

Expand|Select|Wrap|Line Numbers
  1.     me.item_txt.backcolor=vbwhite
  2. if me.item_txt >= "J000" and me.item_txt <= "J999" then
  3.     msgbox "whatever"
  4.     me.item_txt.backcolor=vbred
  5. end
Of course you don't need to do both the red and the msgbox, choose what you like. And red is awfully harsh, I nearly never use plain red.

Jim
Feb 19 '16 #2
hmm didn't seem to like that

I got a complie error : Method or data member not found..

.item_txt is highlighted
Feb 19 '16 #3
@Sheilard

The field is called subjective

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  
  3. Me.subjective.BackColor = vbWhite
  4. If Me.subjective >= "J000" And Me.item_txt <= "J999" Then
  5. MsgBox "This is J code, please check authorisation"
  6. Me.subjective.BackColor = vbRed
  7. End
  8.  
  9. End Sub
  10.  
  11. End Sub
Feb 19 '16 #4
Thank you so much Jimatqsi. That now works a treat
Feb 19 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rajesh | last post by:
dear all, as of now, am working on a simple access database with a normal data entry form Can I design a form in HTML for data entry, and the same be linked to an access database where the...
2
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
3
by: intl04 | last post by:
Is it possible to create a Word form as the data entry form for an Access database? I didn't see any reference to this possibility in my Access books, so I'm sorry if this is a question that is...
2
by: edworboys | last post by:
I have designed a data entry form with a number of fields and a sub form. The first field (Country) is a combo box and the user selects a country. This, in turn reduces the number of options in the...
1
by: Alex.Wisnoski | last post by:
I have a data entry form with a combo box to look up an entrant's name. If the name is already in the table then it pulls up the record and that part of the form works fine. If the name isn't in...
5
by: Aspnot | last post by:
Background: I have a data entry form that is bound to a DataSet. This DataSet contains 9 tables and the form displays data from each table in textboxes, not a DataGrid. One of the tables in the...
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
2
by: seltzer | last post by:
I am using Access 2000 but I also have the 2003 version. I am working on creating a data entry form in Access for a research study. Since there is a maximum of 255 fields per table in Access, I...
0
by: Tyler | last post by:
Made a data entry form which is a subform. I made a continuous form that displays everything entered through the data entry form. The data entry form displays all of the records. This doesn't...
1
by: Ville Mäkelä | last post by:
HI, In my data entry form with combo as well text boxes, I have a commad button which checks for any dublicate data using if clause and Dcount. If there is no dublicates, the data will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.