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

Auto-fill and Required Field

Hi,

I'm currently running Access 2007 on Windows XP Professional. I'm a novice for the most part, and this is my first database. I'm having difficulty figuring out how to do the following:

1. I'm currently setting up a form for the UI. I need to have a Yes/No field set-up so, when checked it auto-fills the date in separate field. I have the fields created, but I do not know how to implement that 'action'.

2. On the same form I have a lookup field. I need to have one of the entries on the drop-down to require an entry on another field. For example: If the look-up field is 'Ice Cream Flavors', and the drop-down option is 'Chocolate', the required field would be 'Milk Chocolate or Dark?'

Please note I have no programming knowledge. Thanks!
Feb 22 '08 #1
2 1442
missinglinq
3,532 Expert 2GB
QUESTION 1:

Place this code in the AfterUpdate event of the checkbox.
Expand|Select|Wrap|Line Numbers
  1.  Private Sub DaterCheckBox_AfterUpdate()
  2.  If DaterCheckBox Then
  3.    Me.MyDateTextBox = Date
  4.  Else
  5.    Me.MyDateTextBox = ""
  6. End If
  7. End Sub
  8.  
QUESTION 2:

We need some more information here! What exactly do you want to happen if 'Chocolate' is selected? Do you want the field for 'Milk Chocolate or Dark' to appear, where it was invisible before? Do you want it to start out being disabled (grayed out) then become enabled? Or do you simply want to check before the record is saved to insure that a choice has been made?

Welcome to TheScripts!

Linq ;0)>
Feb 22 '08 #2
QUESTION 1:

Place this code in the AfterUpdate event of the checkbox.
Expand|Select|Wrap|Line Numbers
  1.  Private Sub DaterCheckBox_AfterUpdate()
  2.  If DaterCheckBox Then
  3.    Me.MyDateTextBox = Date
  4.  Else
  5.    Me.MyDateTextBox = ""
  6. End If
  7. End Sub
  8.  
QUESTION 2:

We need some more information here! What exactly do you want to happen if 'Chocolate' is selected? Do you want the field for 'Milk Chocolate or Dark' to appear, where it was invisible before? Do you want it to start out being disabled (grayed out) then become enabled? Or do you simply want to check before the record is saved to insure that a choice has been made?

Welcome to TheScripts!

Linq ;0)>
Thanks!


"Do you want it to start out being disabled (grayed out) then become enabled?"

Yes, the 'Milk or Dark' field is already on the form and should be, so ideally I would like it to be disabled unless 'Chocolate' is selected.
Feb 22 '08 #3

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

Similar topics

2
by: Manlio Perillo | last post by:
Hi. This post follows "does python have useless destructors". I'm not an expert, so I hope what I will write is meaningfull and clear. Actually in Python there is no possibility to write code...
1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
5
by: Robert Downes | last post by:
I'm using the following in a page that I'm testing in Mozilla: p.actionLinkBlock {border: 1px #000000 dashed; padding: 0.2cm; width: auto} But the dashed border is extending to the right-edge...
20
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
5
by: Samuel | last post by:
Hi, I am running into a problem of mixing UICulture = auto and allowing users to select culture using a dropdown list. I am detecting a querystring, "setlang", and when found, setting the...
5
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
2
by: Piotr K | last post by:
Hi, I've encountered a strange problem with Firefox which I don't have any idea how to resolve. To the point: I've <divelement with a style "height: auto" and I want to retrieve this value...
21
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.