A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Set Controls Default Value from another Control



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2010, 07:30 PM posted to microsoft.public.access.tablesdbdesign
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Set Controls Default Value from another Control

I am working on a form for data entry where the user enters many records that
may have similar information, i am trying to create a tab that would have all
of my "Default" values so that for example if the user was going to enter 40
items from a PO they could go to the Defaults tab and enter the PO# and every
record they enter on the subform would by default have the PO number entered.

I have done this before where my data entry textbox controls default value
is =me![DefaultNotestext] where [DefaultNotesText] is on my Defaults Tab and
it is bound to a 1 record table so the value is there if i close and reopen
the form.

The 1 record table seems excessive can the [DefaultNotesText] be a Unbound
text box that can somehow be set to store the value indefinately

or on activate get the current default value from my NotesText control and
with the afterupdate set a new Default value to my notesText property?

Any help would be greatly appreciated
Thanks
Barry
Ads
  #2  
Old February 22nd, 2010, 08:32 PM posted to microsoft.public.access.tablesdbdesign
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Set Controls Default Value from another Control

Barry,

Stop amd review the design of your tables. You should have something like:
TblPO
POID
PODate
VendorID
other fields pertaining to the whole PO

TblPODetail
PODetailID
POID
POItem (might be ItemID if you have a TblItem)
ItemQuantity
ItemCost

TblPO records data about the PO as a whole. TblPODetail records each item on
a PO, its quantity and its price. Data entry is by a form/subform. The main
form is based om TblPO and the subform is based on TblPODetail. You set the
Linkmaster and LinkChild properties to POID. You don't need to enter POID
for each item in the subform. Access automatically enters POID for each item
in the subform. This ensures each item in TblPODetail is associated with a
specific PO (POID).

Steve



"Barry A&P" wrote in message
...
I am working on a form for data entry where the user enters many records
that
may have similar information, i am trying to create a tab that would have
all
of my "Default" values so that for example if the user was going to enter
40
items from a PO they could go to the Defaults tab and enter the PO# and
every
record they enter on the subform would by default have the PO number
entered.

I have done this before where my data entry textbox controls default value
is =me![DefaultNotestext] where [DefaultNotesText] is on my Defaults Tab
and
it is bound to a 1 record table so the value is there if i close and
reopen
the form.

The 1 record table seems excessive can the [DefaultNotesText] be a Unbound
text box that can somehow be set to store the value indefinately

or on activate get the current default value from my NotesText control and
with the afterupdate set a new Default value to my notesText property?

Any help would be greatly appreciated
Thanks
Barry



  #3  
Old February 22nd, 2010, 08:51 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Set Controls Default Value from another Control

...every record they enter on the subform would by default have the PO
number entered.
The data of the subform should be the many side of a one-to-many
relationship and the Master/Child links between the form/subform set on the
primary/foreign key fields with cascade update so that the PO number does not
need to be entered at all.
No need for a table to hold your default information as once it is loaded
into the form fields as default it stays there. What you could do is to
have an event such that after change to set current values as default for
those fields that are expected to be repetive.

--
Build a little, test a little.


"Barry A&P" wrote:

I am working on a form for data entry where the user enters many records that
may have similar information, i am trying to create a tab that would have all
of my "Default" values so that for example if the user was going to enter 40
items from a PO they could go to the Defaults tab and enter the PO# and every
record they enter on the subform would by default have the PO number entered.

I have done this before where my data entry textbox controls default value
is =me![DefaultNotestext] where [DefaultNotesText] is on my Defaults Tab and
it is bound to a 1 record table so the value is there if i close and reopen
the form.

The 1 record table seems excessive can the [DefaultNotesText] be a Unbound
text box that can somehow be set to store the value indefinately

or on activate get the current default value from my NotesText control and
with the afterupdate set a new Default value to my notesText property?

Any help would be greatly appreciated
Thanks
Barry

  #4  
Old February 23rd, 2010, 12:41 AM posted to microsoft.public.access.tablesdbdesign
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Set Controls Default Value from another Control

Karl
me using "PO" as an example may have been misleading. I am looking for an
easy way for the User to set a fields "Default" value based on their
preference or current project..

the best i could come up with is a "Defaults Tab" on the form with duplicate
controls to hold the "default values" I think your After Change event is
what i am after. how would i code the following? I guess it would have to
be in the "Defaults Tab"'s On-Click event.

Me!NotesDefaultTextbox = Me!NotesTextbox(How do i get the current default
value?)

then in the NotesDefaultTextbox On-Change?? (if its unbound what event do i
want to use??)
Me!NotesTextbox(How do i set the new default value?) = Me!NotesDefaultTextbox

Im there just not thinking right on the details..

Thanks

Barry

"KARL DEWEY" wrote:

...every record they enter on the subform would by default have the PO

number entered.
The data of the subform should be the many side of a one-to-many
relationship and the Master/Child links between the form/subform set on the
primary/foreign key fields with cascade update so that the PO number does not
need to be entered at all.
No need for a table to hold your default information as once it is loaded
into the form fields as default it stays there. What you could do is to
have an event such that after change to set current values as default for
those fields that are expected to be repetive.

--
Build a little, test a little.


"Barry A&P" wrote:

I am working on a form for data entry where the user enters many records that
may have similar information, i am trying to create a tab that would have all
of my "Default" values so that for example if the user was going to enter 40
items from a PO they could go to the Defaults tab and enter the PO# and every
record they enter on the subform would by default have the PO number entered.

I have done this before where my data entry textbox controls default value
is =me![DefaultNotestext] where [DefaultNotesText] is on my Defaults Tab and
it is bound to a 1 record table so the value is there if i close and reopen
the form.

The 1 record table seems excessive can the [DefaultNotesText] be a Unbound
text box that can somehow be set to store the value indefinately

or on activate get the current default value from my NotesText control and
with the afterupdate set a new Default value to my notesText property?

Any help would be greatly appreciated
Thanks
Barry

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 OfficeFrustration.
The comments are property of their posters.