473,480 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Nov 13 '05 #1
2 1829
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" <mb****@earthlink.net> wrote in message
news:gO****************@newsread3.news.atl.earthli nk.net...
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

Nov 13 '05 #2
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:
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

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3714
by: xmp333 | last post by:
Hi, I have a form that is designed as a data sheet view. Attached to this is a subform with some VB code. When the user clicks on a row, the subform should pop up and run the VB code which...
3
7800
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
1
4414
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
1
3117
by: Randy | last post by:
I have tried the code to attach a button to a form and use the help information on coding, but I can't seem to get it to work. I have a main form called MAIN CLIENT INFO2 There is a subform...
1
1574
by: matthewemiclea | last post by:
I have a subform, where in the "on current" event, I display code that is supposed to recognize which record I am pointing to, and then display more specific info in another subform based on that...
1
7255
by: Reginald Bal | last post by:
Main Form/SubForm When I requery or recalc my parent form after I updated a record in my subform, I lose the focus of that particular record in my subform. Instead, the first record is selected....
5
6955
by: christianlott1 | last post by:
I admit my form is pretty complex and may need a total overhaul - I have two subforms synchronized on a form through an unbound text box. When I enter a new record in the second subform it used...
8
18204
by: anansi | last post by:
Hi I have a form called 'shiftviewer' and it contains a subform called 'all shifts for current month subform'. the subform is in datasheet view (access 2007) and the main form is a column...
4
5293
by: John Torres | last post by:
I have added a "Preview Report" button on my main Form Page to mainly "print preview" current page including the 1st subform and I already designed the Report Page for it. But for some reason it...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7010
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3011
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.