473,624 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem updating record from subform if it contains only prefilled values

Hi - (This is my very first post)
I have gotten to this point of registering to post because I have been
spinning my wheels so long, I believe I am all caught up in the weeds.
(and mud)

I have a form, that has several tabs. On one tab, I have a subform
(wr_completion_ subform). This subform is bound to a table
(wr_completion_ table).
On the subform, I have a button from which I have added code to email
a report of the completion data to our wr completion mailbox.
(wr=work request).
I also prefill many of the controls with information from the other
tabs.

If the user clicks on any of the controls in the subform, the table is
updated.
However, if the user accepts all the prefilled info and clicks the
'email' button, a blank report generates (no record on table to
report).

I saw a very similar post from 10/01 where the developer was advised
to use the me.dirty = false and the me.refresh. I have tried this and
other methods I have stumbled upon in the usenet group. Nothing seems
to work.

The table is bound to the subform, but I still added sql to check for
the record existance and if not there, SQL to insert else SQL to
update. I thought a manual insert or update would get around it - it
does not.

One clue: I read somewhere where the record selector will turn to a
pencil if it needs to be updated and will be an arrow if nothing to
update. I turned the record selector on in my subform and noticed it
was an arrow before submitting the report and a pencil after
submitting the report. (was not dirty until sometime AFTER the button
was clicked).

Please - If anyone has any wisdom, I would greatly appreciate it. I
need to be rolling out the product next week. (3/03/04)
Thank you in advance.
Nov 12 '05 #1
5 2440
Maybe it's a cheat, but what if your command button clicks one of the
checkboxes (at random, doesn't matter) *twice*? That does not change the
entry, but does set the record dirty.

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #2
"Mary Litten" <ma*********@al ldata.net> wrote in message
news:83******** *************** ***@posting.goo gle.com...
Hi - (This is my very first post)
I have gotten to this point of registering to post because I have been
spinning my wheels so long, I believe I am all caught up in the weeds.
(and mud)

I have a form, that has several tabs. On one tab, I have a subform
(wr_completion_ subform). This subform is bound to a table
(wr_completion_ table).
On the subform, I have a button from which I have added code to email
a report of the completion data to our wr completion mailbox.
(wr=work request).
I also prefill many of the controls with information from the other
tabs.

If the user clicks on any of the controls in the subform, the table is
updated.
However, if the user accepts all the prefilled info and clicks the
'email' button, a blank report generates (no record on table to
report).

I saw a very similar post from 10/01 where the developer was advised
to use the me.dirty = false and the me.refresh. I have tried this and
other methods I have stumbled upon in the usenet group. Nothing seems
to work.

The table is bound to the subform, but I still added sql to check for
the record existance and if not there, SQL to insert else SQL to
update. I thought a manual insert or update would get around it - it
does not.

One clue: I read somewhere where the record selector will turn to a
pencil if it needs to be updated and will be an arrow if nothing to
update. I turned the record selector on in my subform and noticed it
was an arrow before submitting the report and a pencil after
submitting the report. (was not dirty until sometime AFTER the button
was clicked).

Please - If anyone has any wisdom, I would greatly appreciate it. I
need to be rolling out the product next week. (3/03/04)
Thank you in advance.


At first glance, it look sto me as if you do not actually create a record in
the subform and that is why it the report is blank. Imagine you did
everything as you described (simply pressing the button and 'accepting the
defaults') but with the AllowAdditions property of the subform turned off.
Now what happens?
Was there some event, some code which creates the related record? Or do you
find that no record is created? If I am on the right track here, then
perhaps you need to ask yourself:
Should one (or more) related records be automatically created without user
intervention?
What event should trigger the creation of the related record(s)?

Fletcher
Nov 12 '05 #3
thanx for the quick response.
I don't have any check boxes, but I appended a space to one of the
fields - and it worked.

stProjName = Forms![* Project
Communication]![WR_Completion_S ubform].Form![Project Name] & " "
Forms![* Project
Communication]![WR_Completion_S ubform].Form![Project Name] = stProjName

I'd like to figure out how to do it without cheating, though. The
screen kinda winks/blinks at me because of the 'cheat'. Like it knows
what I am up to :)!

However - I this will at least let me hit my deadline. Hopefully I can
get a better understanding later and remove the 'cheat'.

thanx again!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4
Thanx for the feedback, Fletcher. I have included your questions and my
responses below. If you have a suggestion for a solution, let me know.

with the AllowAdditions property of the subform turned off.
Now what happens?
-> The subform does not display. I'm not sure what this shows me??

Was there some event, some code which creates the related record? Or do
you
find that no record is created?
-> The form is bound to the table. This should cause the data to be
prepared for insert into the table, but the insert is not committed to
the table until you leave the form.
Should one (or more) related records be automatically created without
user intervention?
-> In this case, Yes. They review the information on the screen before
sending the report and have the opportunity to change it. If the report
has not been sent, no harm has been done.

What event should trigger the creation of the related record(s)?
-> The button that submits the report should create the record. However,
once again, it does not save the data until the user leaves the form.
(the button alone does not fire any of the events). I have tried code
in a variety of places to no avail.

I would like to find out HOW to commit the updates before the report is
created - and/or WHERE to put the update (dirty) logic.
FYI - if the record has been previously created and the user returns to
the form and updates the data, followed by submitting the report, the
updates ARE reflected. So, I finally got that logic to work. The
difference here is that the user has to click on a control on the form
to fire the update.
Knowledge (like life) is a journey, not a destination.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
"Mary" <an*******@devd ex.com> wrote in message
news:40******** *************@n ews.frii.net...
Thanx for the feedback, Fletcher. I have included your questions and my
responses below. If you have a suggestion for a solution, let me know.

with the AllowAdditions property of the subform turned off.
Now what happens?
-> The subform does not display. I'm not sure what this shows me??

Was there some event, some code which creates the related record? Or do
you
find that no record is created?
-> The form is bound to the table. This should cause the data to be
prepared for insert into the table, but the insert is not committed to
the table until you leave the form.
Should one (or more) related records be automatically created without
user intervention?
-> In this case, Yes. They review the information on the screen before
sending the report and have the opportunity to change it. If the report
has not been sent, no harm has been done.

What event should trigger the creation of the related record(s)?
-> The button that submits the report should create the record. However,
once again, it does not save the data until the user leaves the form.
(the button alone does not fire any of the events). I have tried code
in a variety of places to no avail.

I would like to find out HOW to commit the updates before the report is
created - and/or WHERE to put the update (dirty) logic.
FYI - if the record has been previously created and the user returns to
the form and updates the data, followed by submitting the report, the
updates ARE reflected. So, I finally got that logic to work. The
difference here is that the user has to click on a control on the form
to fire the update.

Hi Mary,
Now it seems very clear what is happening - if the user does not use the
subform, then no record ever gets created.

Here is one possible solution:

On your main form set AllowAdditions to false.
Create a new button on the form which says New... and performs the following
actions:

1. Creates and saves a new main record
2. Creates and saves a related record
3. Requeries the main form
4. Goes to the newly created main record

Would you be able to write the code for this?

One question I still have is this:
If one (and only one?) related record needs to be created automatically in
the subform, then are you sure the 2 records don't belong in the same table,
or can you have more related records but a minimum of one?

I don't know what the table structure is like, but in a typical database you
might have tblOrders and tblOrderItems and you might have a button saying
"New Order". When you press it, it creates asks you what you want to order,
then creates a new order with today's date, etc and a single new order item.
It then takes you to the order record where you could add more items. The
point is that it automatically creates the first one since an order with no
items might make no sense. Is your a similar scenario?
Fletcher
Nov 12 '05 #6

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

Similar topics

3
2469
by: Ryan.Chowdhury | last post by:
This is a general question regarding the use of view and stored procedures. I'm fairly new to databases and SQL. I've created a SQL database using an Access Data Project ("ADP") and I'm satified with the table structure. I've moved on to building some front ends for our users. I'm running into situations where I want subreports to be built from queries that are dependent on the values in other controls. I've played with stored...
2
2233
by: Lyn | last post by:
Hi, I am working on a genealogy project in which I have two tables: Person -- one record for each person in the family. Each record has a unique Autonum field (IDPerson). Partnerships -- one record for each marriage. Each record has a unique Autonum field (ID), and also contains two fields IDPartnerMale and IDPartnerFemale. Both of the latter fields match records in the Person table via IDPerson.
4
7001
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
4
2272
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5 companies on a form. 3 of the companies have common employees. I have a table that looks like this:
5
5246
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test box that is populated with the code =subfrm_media_review_sec_party.Form!first_name & " " & subfrm_media_review_sec_party.Form!last_name It works except that when I flip through the names it populates the parent form with the name of what ever...
1
2712
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the ftp site and gets the file name for any update files on the site. I already have code to do this...
9
9681
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
7
4535
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
1
1758
geolemon
by: geolemon | last post by:
I have a form/subform used for inventory management. It is a bound form. The error: I don't understand what this means. How the form is intended to work: When you select a part number in the main form, the subform displays potentially several instances of that part number in inventory, and is designed to allow the inventory manager to adjust the quantities for each instance of the part in inventory.
0
8240
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8482
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6111
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2610
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
2
1487
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.