Why don't I get an error message?

T

Tony Williams

I have a control on a form which is based on a field in a table. The Required
property of the field in the table is set to Yes but when I enter a record
and leave the control blank I don't get an error message. I want to make sure
that this control is not null before the user updates the form. I was going
to trap the error and show a message like "You must fill in the name"
Can anyone explain why I don't get the error?
Thanks
Tony
 
J

Jeanette Cunningham

When you look in the table, is the record from the form saved in the table
with null for the required field?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
T

Tony Williams

Hi Jeanette. The required field is on a main form and the rest of the data is
on a subform. The data in the subform is saved but the data for the field
linking the main and sub forms is blank.
Thanks
tony
 
T

Tony Williams

Hi Bruce yes I have linked the two fields as you described.
Tony

BruceM via AccessMonster.com said:
Have you set established relationships between those fields, and have you set
the Link Child and Link Master properties of the subform control to the
linking fields?

Tony said:
Hi Jeanette. The required field is on a main form and the rest of the data is
on a subform. The data in the subform is saved but the data for the field
linking the main and sub forms is blank.
Thanks
tony
When you look in the table, is the record from the form saved in the table
with null for the required field?
[quoted text clipped - 14 lines]

--
Message posted via AccessMonster.com


.
 
G

Gina Whipp

Toy,

Go to the table in deisgn mode and please type here what is on the General
tab of that field... Sounds like something might be set wrong there.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Tony Williams said:
Hi Bruce yes I have linked the two fields as you described.
Tony

BruceM via AccessMonster.com said:
Have you set established relationships between those fields, and have you
set
the Link Child and Link Master properties of the subform control to the
linking fields?

Tony said:
Hi Jeanette. The required field is on a main form and the rest of the
data is
on a subform. The data in the subform is saved but the data for the
field
linking the main and sub forms is blank.
Thanks
tony

When you look in the table, is the record from the form saved in the
table
with null for the required field?
[quoted text clipped - 14 lines]

.

--
Message posted via AccessMonster.com


.
 
T

Tony Williams

Hi Gina here it is

Format mmmm/yyyy
Required Yes
Indexed Yes (no Duplicates)
IME Mode No Control
OME Senetence Mode None
Text align General
Show date picker for dates

Any help?
Thanks
Tony
Gina Whipp said:
Toy,

Go to the table in deisgn mode and please type here what is on the General
tab of that field... Sounds like something might be set wrong there.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Tony Williams said:
Hi Bruce yes I have linked the two fields as you described.
Tony

BruceM via AccessMonster.com said:
Have you set established relationships between those fields, and have you
set
the Link Child and Link Master properties of the subform control to the
linking fields?

Tony Williams wrote:
Hi Jeanette. The required field is on a main form and the rest of the
data is
on a subform. The data in the subform is saved but the data for the
field
linking the main and sub forms is blank.
Thanks
tony

When you look in the table, is the record from the form saved in the
table
with null for the required field?
[quoted text clipped - 14 lines]

.

--
Message posted via AccessMonster.com


.


.
 
G

Gina Whipp

Tony,

Hmmm, okay well that's not it. What do you have under Access Options -
Advanced - Confirm section?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Tony Williams said:
Hi Gina here it is

Format mmmm/yyyy
Required Yes
Indexed Yes (no Duplicates)
IME Mode No Control
OME Senetence Mode None
Text align General
Show date picker for dates

Any help?
Thanks
Tony
Gina Whipp said:
Toy,

Go to the table in deisgn mode and please type here what is on the
General
tab of that field... Sounds like something might be set wrong there.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Tony Williams said:
Hi Bruce yes I have linked the two fields as you described.
Tony

:

Have you set established relationships between those fields, and have
you
set
the Link Child and Link Master properties of the subform control to
the
linking fields?

Tony Williams wrote:
Hi Jeanette. The required field is on a main form and the rest of the
data is
on a subform. The data in the subform is saved but the data for the
field
linking the main and sub forms is blank.
Thanks
tony

When you look in the table, is the record from the form saved in
the
table
with null for the required field?
[quoted text clipped - 14 lines]

.

--
Message posted via AccessMonster.com


.


.
 
G

Gina Whipp

Tony,

Try running a Compact & Repair and is there any code behind the Control. If
there is copy/paste that here.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

TonyWilliams via AccessMonster.com said:
Hi Gina I have Confirm Record Changes and Document Deletions
Any help?
Thanks
Tony
PS Merry Christmas!

Gina said:
Tony,

Hmmm, okay well that's not it. What do you have under Access Options -
Advanced - Confirm section?
Hi Gina here it is
[quoted text clipped - 43 lines]
 
J

Jeanette Cunningham

Would you post back with the name, primary key, relationships of the 2
tables involved.
For the main form and sub form, the recordsource for each.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeanette Cunningham

You can use the before insert event of the subform. It allows you to prevent
the user entering anything in the subform if the main form is blank.

Something like this example code-->

If Me.Parent.[NameOfMainForm].NewRecord = True Then
Cancel = True
MsgBox "Type in the main form first"
End If

The above code will pop up a message every time the user tries to enter
something in the subform while the main form is empty.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



TonyWilliams via AccessMonster.com said:
Thanks Jeanette. In frustration I followed advice from another MVP
(Sorry!)
and made the subform inactive until the control on the main form was input
on
the basis that prevention was better than cure. I just need to find a way
now
to pop up a message box to explain to the user why the form is inactive. I
was thinking of onOpen-> control focus->on exit control->check if empty,
if
so message box. What do you think? I'm not a VB expert so it may take me a
while to figure that out! Especially over the festive season!
Thanks again for your input and have a great Christmas and New Year
Tony

Jeanette said:
Would you post back with the name, primary key, relationships of the 2
tables involved.
For the main form and sub form, the recordsource for each.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Hi Linq no I'm not using a Close button.
Thanks
[quoted text clipped - 28 lines]
and if a violation has occurred, will throw up a warning message
allowing
correction to be made before closing the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top