473,546 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ 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 1836
well, presumably the subform's RecordSource is a query or SQL statement that
uses some criteria (perhaps something like "Completion Date 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!MainFormN ame!PrimaryKeyF ield

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****@earthli nk.net> wrote in message
news:gO******** ********@newsre ad3.news.atl.ea rthlink.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.RunComman d 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
3725
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 accesses the record corresponding to the row clicked. To get this row, I tried using Me.Parent.Bookmark. Unfortunately, this gets the "Current...
3
7807
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 acCmdDelete Record? Thanks! Maria
1
4426
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 created a MainTable (and related form), which has an associated SubForm (popup) along with its underlying, separate Table. The tables'...
1
3125
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 called Client Contacts. I want to print the current record using the ID field in the Client Contacts subform in a report. I want to print to a report...
1
1579
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 one record that I have highlighted. Example.... you point to ID Number: 1111 in the top subform.... all specific info for ID Number: 1111 will...
1
7271
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. How can I avoid this? -- Reginald Bal
5
6967
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 to complain about nulls and then about 'can't repeat an index'. To solve this I wrote code on the main form's subform enter event (I'm surprised I...
8
18212
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 orientated form. Both forms contain records of 'shifts' I want to be able to select a record (a shift) in the subform, and be able to set the parent...
4
5305
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 pulls out all the report. I am currently using the below SQL. I also made it to a point where it prints the current record but it does not include 1st...
0
7504
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7792
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3491
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
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 we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.