Default Field Entry

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

Guest

Hi all - Access 2002 XP - WinM

I have a field in a table that is to contain only one value at all times. Field name; AcctCode, and the account number is
100 53105. I have tried to set it up as the default for this field in the table, but, so far it will just require that you enter this value, it does not carry it over automatically in this field for all records displayed. There are specific purchases that must be charged to this account number for reimbursement by the city for special events, and this is the only account number that will be used for all of those purchases by our department.

The form is a single form view, no subform

I would truly appreciate it if someone would advise me as to what method I should use to set up this field so that the default account code number will automatically display in this field for all records.

Best regards

Jan :
 
Jan Il said:
Hi all - Access 2002 XP - WinME

I have a field in a table that is to contain only one value at all times.
Field name; AcctCode, and the account number is;
100 53105. I have tried to set it up as the default for this field in
the table, but, so far it will just require that you enter this value, it
does not carry it over automatically in this field for all records
displayed. There are specific purchases that must be charged to this
account number for reimbursement by the city for special events, and this
is the only account number that will be used for all of those purchases by
our department.
The form is a single form view, no subform.

I would truly appreciate it if someone would advise me as to what method
I should use to set up this field so that the default account code number
will automatically display in this field for all records.

Point 1)
Default values apply to all future records which you create. They do
nothing to records that already exist.

Point2)
If you need to backfill existing records with your default value you need
to use an Update query.

UPDATE YourTableName SET AcctCode = '100 53105'

The above assumes that your inclusion of a space was not a typo and that
therefore this is a text field and not a numeric one. If that assumption
is wrong you would remove both the space and the quotes.

Point 3)
If this value is NEVER going to change then it doesn't need to be in your
database at all. You could just use a constant expression in any form,
report, or query where the value needs to be displayed.
 
Hi Rick

----- Rick Brandt wrote: ----

Jan Il said:
Hi all - Access 2002 XP - WinM
Field name; AcctCode, and the account number is
100 53105. I have tried to set it up as the default for this field i
the table, but, so far it will just require that you enter this value, i
does not carry it over automatically in this field for all record
displayed. There are specific purchases that must be charged to thi
account number for reimbursement by the city for special events, and thi
is the only account number that will be used for all of those purchases b
our departmentI should use to set up this field so that the default account code numbe
will automatically display in this field for all records

That is what I would like to do, and was trying to do, but, was not successful

Point 1
Default values apply to all future records which you create. They d
nothing to records that already exist

No..this is a new database create for this specific purpose. There are no records as yet

Point2
If you need to backfill existing records with your default value you nee
to use an Update query

UPDATE YourTableName SET AcctCode = '100 53105

The above assumes that your inclusion of a space was not a typo and tha
therefore this is a text field and not a numeric one. If that assumptio
is wrong you would remove both the space and the quotes

Correct....the space is part of the account code, to specify cost center (100) and account number (53105). Yes, it is set up as a text field for this entry

Point 3
If this value is NEVER going to change then it doesn't need to be in you
database at all. You could just use a constant expression in any form
report, or query where the value needs to be displayed

I have been told that this will be the only account number for this specific type of purchase, however, in my experience with dealing with cities, and our accounting dept., things can/do change. I would prefer to leave some type of window open in the beginning in the event there is need to revise or add to the existing account code up stream, yet still provide for the automatic fill for each record. I suppose I could set up a combo or list box for this field, but, that would mean an additional entry step at this point.

A question here, if I may. If I leave the field as a text box and then enter code or do whatever is necessary to automatically fill this control for each record, would it be possible at a point upstream to change the text box to a list or combo box should other account codes need to be added, without compromising any existing data? I ask as, my first thought is that it would pose no problem. But, I have learned many things about Access and one is...you should not assume anything for sure. ;-
I realize that if such a change was made later on, the current auto fill set up would have to be changed, so that is why I asked ahead, so that I have a clear understanding of all aspects of the situation now, and at a possible later date to implement the best solution

Thank you very much for your time and assistance, I really do appreciate it

Jan :
 
Jan Il said:
Hi Rick!

That is what I would like to do, and was trying to do, but, was not successful.

Point 1)
Default values apply to all future records which you create. They do
nothing to records that already exist.

No..this is a new database create for this specific purpose. There are no
records as yet.

If in the table design you specify "100 53105" as the default value property
for this field then any new records you create WILL have this value
automatically inserted. I have never seen any problems with this.
Point 3)
If this value is NEVER going to change then it doesn't need to be in your
database at all. You could just use a constant expression in any form,
report, or query where the value needs to be displayed.

I have been told that this will be the only account number for this
specific type of purchase, however, in my
experience with dealing with cities, and our accounting dept., things
can/do change. I would prefer to leave
some type of window open in the beginning in the event there is need to
revise or add to the existing account
code up stream, yet still provide for the automatic fill for each record.
I suppose I could set up a combo or list > box for this field, but, that
would mean an additional entry step at this point.

If there is a possibility of it changing or needing to accomodate different
entries at a later date then I agree that you should store it.

A question here, if I may. If I leave the field as a text box and then
enter code or do whatever is necessary to automatically fill this control
for each record, would it be possible at a point upstream to change the text
box to a list or combo box should other account codes need to be added,
without compromising any existing data? I ask as, my first thought is that
it would pose no problem. But, I have learned many things about Access and
one is...you should not assume anything for sure. ;-)

That would be an easy thing to change at a later date.
 
Hi RIck,

Rick Brandt said:
no
records as yet.

If in the table design you specify "100 53105" as the default value property
for this field then any new records you create WILL have this value
automatically inserted. I have never seen any problems with this.

Then I will try again. Evidently, I am not doing something correct since it
is not following through as you suggest.
in
specific type of purchase, however, in my
can/do change. I would prefer to leave
revise or add to the existing account record.
I suppose I could set up a combo or list > box for this field, but, that
would mean an additional entry step at this point.

If there is a possibility of it changing or needing to accomodate different
entries at a later date then I agree that you should store it.

'k...then this is something that I will follow up on. I know storing some
data is not good, so I tarry to do so unless it is really necessary.
enter code or do whatever is necessary to automatically fill this control
for each record, would it be possible at a point upstream to change the text
box to a list or combo box should other account codes need to be added,
without compromising any existing data? I ask as, my first thought is that
it would pose no problem. But, I have learned many things about Access and
one is...you should not assume anything for sure. ;-)

That would be an easy thing to change at a later date.

Very good. At least I know how best to plan for the
unexpected...well...sorta anyway. ;-)

Thank you very much for your time and assistance with this issue, I truly do
appreciate it.

Jan :)
 
Back
Top