Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Pre-fill controls in subsequent records of continuous form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rheath - 17 Jul 2007 14:14 GMT
In a form (actually subform - but I don't think that makes a difference) in
which multiple records all have mostly the same control information (except
one control-StudentName) I would like all those other fields on the form to
pre-fill with the previous record info.  Now, they are all blank and have to
be entered again. I thought about making a subform with just the name field.  
But isn't there an easier way?
Allen Browne - 17 Jul 2007 14:32 GMT
See:
   Assign default values from the last record - Carry data over
at:
   http://allenbrowne.com/ser-24.html

Copy the code into your database, and follow the steps to set it up. The
code copies all fields down, but is clever enough not to try to duplicate
the autonumber or copy to calculated fields and controls, or unbound
controls. You can also specify particular fields you don't want copied in
the "exception list."

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> In a form (actually subform - but I don't think that makes a difference)
> in
[quoted text clipped - 7 lines]
> field.
> But isn't there an easier way?
rheath - 18 Jul 2007 00:52 GMT
I tried this, but got a compile error on the line:
Dim rs As DAO.Recordset         'Clone of form
I don't understand enough VB to know how to fix this.
Can you help me further?
I do appreciate your help.
THis is for a continuous form in dataentry Yes so there is no 'first
record'.  If it is the first time through, nothing should be preloaded.  If
this were Cobol I'd know what to do (tells you how old I am....)  Wish I knew
more VB but I'm a math faculty now and only get to dabble in this once in a
while.
Ruth

> See:
>     Assign default values from the last record - Carry data over
[quoted text clipped - 18 lines]
> > field.
> > But isn't there an easier way?
Allen Browne - 18 Jul 2007 01:19 GMT
See:
   http://allenbrowne.com/ser-38.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I tried this, but got a compile error on the line:
> Dim rs As DAO.Recordset         'Clone of form
[quoted text clipped - 36 lines]
>> > field.
>> > But isn't there an easier way?
rheath - 25 Jul 2007 23:40 GMT
I did eventually figure out how to recompile with the missing DAO library.
I tried to not carryover 3 of the fields- an ID field and the 2 names
associated with it the came from a combo box.
But when I tested it, the first field is a combo box of a
CourseID/Coursename and it gave me the error:
Can not carry values over.  Form , formname> has no records.
Can you help again?

> See:
>     http://allenbrowne.com/ser-38.html
[quoted text clipped - 39 lines]
> >> > field.
> >> > But isn't there an easier way?
Allen Browne - 26 Jul 2007 06:01 GMT
It works only with bound forms, where there are records.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I did eventually figure out how to recompile with the missing DAO library.
> I tried to not carryover 3 of the fields- an ID field and the 2 names
[quoted text clipped - 53 lines]
>> >> > field.
>> >> > But isn't there an easier way?
rheath - 26 Jul 2007 16:22 GMT
There are records on this form whose controls are bound.

Where does it expect to get the info from, if not the first record on the
form?

So, is there no way to fill a 2nd, 3rd, 4th, etc record (one at a time, as
you need them) with info in first record?  I'm not sure why you'd ever want
to

I did try the first method of the 2 you suggested which directed me to
another MVP's page who suggested setting Me.DefaultValue with
Me.ControlValue.  This did set the default and the second record was
pre-filled with that default, but there was no way to change that.  It
wouldn't let me alter the control value in the form (just in case some
fields/controls need to be altered from the usual prefilled value).

Any help would be appreciated.
Thanks,
Ruth Heath

> It works only with bound forms, where there are records.
>
[quoted text clipped - 55 lines]
> >> >> > field.
> >> >> > But isn't there an easier way?
Allen Browne - 27 Jul 2007 10:18 GMT
Sorry, Ruth: I'm down with the 'flu at present, not able to think straight.

Perhaps someone else can make a suggestion.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> There are records on this form whose controls are bound.
>
[quoted text clipped - 86 lines]
>> >> >> > field.
>> >> >> > But isn't there an easier way?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.