How to save a record with default values???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there - may seem like a really simple thing but for some reason I can't
get this to work,

I have a form in which I want to create a new record,

I then have a subform within the form in which I want to create a new record
when appliciable.
The form and subform are linked by a 1 to 1 relationship and I am using
default value in the field control to add the value from the form to the
subform.
I also have another field in there which is based on another table for info
and has 1 bound column - I defaulted this value too.

I don't want the user to need to go into the subform if they are happy with
the defaults but for some reason thes record is not saving to the table -
what am I doing wrong??

Thanks for any advice
hazel
 
huzzlepuzzle said:
Hi there - may seem like a really simple thing but for some reason I
can't get this to work,

I have a form in which I want to create a new record,

I then have a subform within the form in which I want to create a new
record when appliciable.
The form and subform are linked by a 1 to 1 relationship and I am
using default value in the field control to add the value from the
form to the subform.
I also have another field in there which is based on another table
for info and has 1 bound column - I defaulted this value too.

I don't want the user to need to go into the subform if they are
happy with the defaults but for some reason thes record is not saving
to the table - what am I doing wrong??

Thanks for any advice
hazel

A record will not be automatically created based ONLY on defaults values.
In most cases this would be constantly generating unwanted records. So your
user (or your code/macro) must set the value of at least one field and then
a record will be created.
 
Aha - thanks Rick, I didn't realise this wasn't allowed, how do I do this in
code, can you advise?
 
huzzlepuzzle said:
Aha - thanks Rick, I didn't realise this wasn't allowed, how do I do
this in code, can you advise?

Pick an event. All you need to do is set a field equal to itself.

Me.FieldName = Me.FieldName

If the creation of the sub-record is up to the user just give them a button to
press [ Accept Defaults ] for example, that does the above and you should be all
set.
 
Thanks Rick - did the trick
--
Kind Regards

Hazel


Rick Brandt said:
huzzlepuzzle said:
Aha - thanks Rick, I didn't realise this wasn't allowed, how do I do
this in code, can you advise?

Pick an event. All you need to do is set a field equal to itself.

Me.FieldName = Me.FieldName

If the creation of the sub-record is up to the user just give them a button to
press [ Accept Defaults ] for example, that does the above and you should be all
set.
 
Hi I have a question about default value for combobox default as following

I have combobox and there abvout 30 itemes on combpobox. I wanna set any
value as default value.

For example When i selected item "A" and save it, i want A to be default. Or
when i select item "B", B shoul be default value. How can i do this.I do not
wanna fix default value, but i want when i select any item from combo and
save to data i want it to be as default value? Any suggestion?
 
Back
Top