Connecting Tech Pros Worldwide Help | Site Map

Include Current Record In Subform

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 03:03 AM
Melissa
Guest
 
Posts: n/a
Default Include Current Record In Subform

I have a single (not continuous) form with an Undo button for entering
finished projects. On the form is also a subform that lists all finished
projects for reference. When I enter the CompletionDate which is near the
beginning of all the fields, I would like the current project to appear in
the subform which lists all the finished projects. I can't save the current
project at that point because I wouldn't be able to use the Undo button
after that. How can I display the unsaved current project in the list of
finished projects after I enter the completion date? I am open to using a
listbox instead of a subform if that would make it possible.

Thanks!

Melissa



  #2  
Old November 13th, 2005, 03:03 AM
tina
Guest
 
Posts: n/a
Default Re: Include Current Record In Subform

well, presumably the subform's RecordSource is a query or SQL statement that
uses some criteria (perhaps something like "CompletionDate Is Not Null") to
display only completed records. until you save the CompletionDate entered in
the current project record, the data is not in the table, and so it can't be
pulled by the subform's RecordSource.

the closest thing i can think of is to change the RecordSource, perhaps in
the CompletionDate control's AfterUpdate event, setting criteria to
something like

CompletionDate Is Not Null Or PrimaryKeyField =
Forms!MainFormName!PrimaryKeyField

and then requerying the subform. that would give you all completed (and
saved) records, plus the current mainform record.
you'd have to contend with resetting the RecordSource back to the original
each time you move to another record, and also in the event of an Undo
command.

hth


"Melissa" <mbaker@earthlink.net> wrote in message
news:gO53d.6476$mb6.440@newsread3.news.atl.earthli nk.net...[color=blue]
> I have a single (not continuous) form with an Undo button for entering
> finished projects. On the form is also a subform that lists all finished
> projects for reference. When I enter the CompletionDate which is near the
> beginning of all the fields, I would like the current project to appear in
> the subform which lists all the finished projects. I can't save the[/color]
current[color=blue]
> project at that point because I wouldn't be able to use the Undo button
> after that. How can I display the unsaved current project in the list of
> finished projects after I enter the completion date? I am open to using a
> listbox instead of a subform if that would make it possible.
>
> Thanks!
>
> Melissa
>
>[/color]


  #3  
Old November 13th, 2005, 03:03 AM
Steve Schapel
Guest
 
Posts: n/a
Default Re: Include Current Record In Subform

Melissa

I would use some code (e.g. DoCmd.RunCommand acCmdSaveRecord) on the
AfterUpdate event of the CompletionDate control to write the new record
to the table and then Requery the subform. I know you feel you won't be
able to use an 'Undo' button, as you said, but unless there is some
other reason which we don't know about, I can't see why not... just put
code on your Undo button to delete the record.

--
Steve Schapel, Microsoft Access MVP


Melissa wrote:[color=blue]
> I have a single (not continuous) form with an Undo button for entering
> finished projects. On the form is also a subform that lists all finished
> projects for reference. When I enter the CompletionDate which is near the
> beginning of all the fields, I would like the current project to appear in
> the subform which lists all the finished projects. I can't save the current
> project at that point because I wouldn't be able to use the Undo button
> after that. How can I display the unsaved current project in the list of
> finished projects after I enter the completion date? I am open to using a
> listbox instead of a subform if that would make it possible.
>
> Thanks!
>
> Melissa
>
>[/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.