By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,775 Members | 2,658 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,775 IT Pros & Developers. It's quick & easy.

Re Acuring Data in Forms

P: n/a
Doc
Would you enter this in as an "event procedure" or right in the properties
of the combo box under event / afterupdate. I kept getting an error message
that it could not find the Macro "Me!", when I tried it as an event
procedure it did not understand the argument. I'm sure its me doing
something wrong but I don't know what.
Thanks Doc

----- Original Message -----
From: "Arno R" <ar****************@tiscali.nl>
Newsgroups: comp.databases.ms-access
Sent: Saturday, September 27, 2003 4:25 AM
Subject: Re: Auto complete forms

Doc,
Maybe I wasn't explicit enough .. It's really very simple though.
You need code like I gave you in the AfterUpdate-event *of each combo or field* that you would like to set a defaultvalue for.
So when you have two controls in your form e.g. Field 1 and Combo2 you need the code:
Sub Field1_AfterUpdate()
Me!Field1.DefaultValue=Me!Field1
end sub

Sub Combo2_AfterUpdate()
Me!Combo2.DefaultValue=Me!Combo2
end sub

The advantage of this approach is that *every* time another value is entered this new value behaves as the defaultvalue.
You can use this on any form where there are more recurring values to be entered.
--
Hope this helps
Arno R

"Doc" <do*******@hotmailremove.com> schreef in bericht
news:l7******************@bignews3.bellsouth.net.. .
I could not get that code to work maybe I didn't enter it right.
"Arno R" <ar****************@tiscali.nl> wrote in message
news:bk**********@reader1.tiscali.nl...
Hi Doc,

You could set the defaultvalue of some comboboxes or fields at runtime. So when the form opens there are no defaultvalues but when the first

record is entered then there
are.
Put this in the AfterUpdate-Event:

Me!ComboOrField.Defaultvalue=Me!ComboOrField.Value
You could also set
Me!ComboOrField.TabStop=false to prevent users tabbing to the

fields once they have a
defaultvalue
--
Hope this helps
Arno R
"Doc" <do*******@hotmail.com> schreef in bericht

news:Hb*****************@bignews4.bellsouth.net...
>
> The question is. I have a form that half the data is the same and I want
it
> to recur. example I have different users at different locations.
> When "john" opens the form I would like it to prompt him for his
name, date,
> and department. Then this info would recur through each record that
he > enters while this form is open. Then he could close the form and

Susie could
> do the same. I can set up defaults in forms to do this but I need
the these
> to be chosen from drop down menus. So that the data is the same each

time.
> There are multiple users for this data base. Each user would be
entering in
> around 60 records per session
>
>
>



Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.