Hi Guys,
Wonder if anyone could help me out.
I've got a form [FrmQuoteHeader] with a record source link to [TblQuoteHeader]. The form has a subform embedded. The link between the two is a job number [QuoteNumber]. I am trying (and failing) to update a 'Yes/No' [ShowInJobs] field on the form/table when a 'Yes/No' [Job] field is updated in the subform.
So, basically, when any one of the subform records has the field [Job] set to YES, it updates the [ShowInJobs] field in the table [TblQuoteHeader].
Hope that makes sense!?! :-S
Any help would be great.
3 1732
Hello, Andy.
I suggest you the following: - modify [FrmQuoteHeader].RowSource so it will return field which will be True when any record in subform's linked table (lets call it [tbl]) has [Job] field set to True
-
SELECT [TblQuoteHeader].*, -Sgn(DCount("*","tbl","[QuoteNumber]=" & [TblQuoteHeader].[QuoteNumber] & " AND [Job]=True")) AS blnShowInJobs
-
FROM [TblQuoteHeader];
-
* using DLookUp instead of DCount supposed to be more effective as it prevent the whole table scanning -
... -Sgn(Nz(DCount("[QuoteNumber]","tbl","[QuoteNumber]=" & [TblQuoteHeader].[QuoteNumber] & " AND [Job]=True"),0)) AS blnShowInJobs
-
- set [ShowInJobs].ControlSource property to blnShowInJobs
- for the subform [Job] control write the following AfterUpdate event handler
-
Private Sub bln_Job()
-
Me.Parent.Refresh
-
End Sub
-
Regards,
Fish
Hi Fish,
Thanks for the reply.
Just a question, when you say update the RowSource in your first point, do you mean the RecordSource? or am I not understanding something?
I'm just trying to understand the whole thing rather than just 'copy' 'paste'.
Thanks,
Andy.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Kunal |
last post by:
Hi,
I need some help on writing an update query to update "UnitsSold" field in
Products Table whenever I save a transaction. The transaction may contain
several "Subtransactions", one for each...
|
by: Rosy |
last post by:
I have a sub-form(company name & address) that is connected to my
contact listing. When I change the contact, it doesn't update the
subform until I close the main form or refresh. Is there a way...
|
by: DP |
last post by:
hi.,
i've got 3 tables, customer, film and filmrental.
i've got a customer form, with a sub form at the bottom, which is a film
rental subform.
i've created an update query, which when a...
|
by: jburris |
last post by:
I am completely new to VBA. I am trying to update a yes/no box in a
subform based on a value that I call from the main form into the
subform. Below is the if /then statement i am using:
If...
|
by: jeffro |
last post by:
I have a database used for recording survey data. In the database, I
have a form that displays a survey participant and a subform that is
filled in by selecting a question from a looklist and...
|
by: Access Programming only with macros, no code |
last post by:
ERROR MESSAGE:
Could not update; currently locked by another session on this
machine.
BACKGROUND
I have the following objects:
Table1 - HO (which has about 51,000+ records)
Table2 -...
|
by: KevinPreston |
last post by:
Hello everyone, this is my first post so apologies if i dont get it right
first time, i am a self taught Access user, i am stuck on something i am
trying to do, briefly i have 2 tables, one for...
|
by: sconard |
last post by:
When you create a form based on a table via access 2007 wizard, form will update when moving from field that has changed to another field within form. Each loss of focus in "changed" fields causes...
|
by: Rosie |
last post by:
I have a main form with header info w/ 'tHeader' as the control source.
I have a subform with 'tDetail' as a control source.
They're strung together by a field named MA_ID.
This works...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
| |