473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Storing values in fields based on other field with checkbox

Hello, I have a field "MappedTo" in a subform "OldCodes" thats needs to refer to a field "NCodes" in the main form "NewCodes" based on whether a field in the subform "Decision" is checked or not. I would like it so when a user clicks the checkbox for "Decision", "MappedTo" is automatically updated with whatever the current "NCode" is in the main form. I can sorta do this by using

IIf([Decision]=-1,Forms!NewCodes![NCodes]," ")

as the control source for "MappedTo", but this gives me a problem. Each "old code" in the subform can possibly map to multiple "new codes" in the main form, but I would like the resulting value from the function to be the same throughout each record, and not recalculated each time it appears. Also I am having trouble storing this value in its underlying table.

In short, I need to know how to store a calculated if-then field to an underlying table, and for the calculation to only be performed on the actual click of the checkbox, not if a checkbox is already clicked or not.

I've messed around with several BeforeUpdate, AfterUpdate, and OnClick codes as well as trying to store in hidden textboxes, but keep getting errors. Please help, thanks to anyone who can.
Jun 30 '10 #1

✓ answered by NeoPa

I suggest you use the Decision_AfterUpdate() event procedure in your sub form to set Me.MappedTo to Me.Parent.NCode.

3 1588
NeoPa
32,556 Expert Mod 16PB
I suggest you use the Decision_AfterUpdate() event procedure in your sub form to set Me.MappedTo to Me.Parent.NCode.
Jul 1 '10 #2
Thanks for the response, I think that might have helped it but I've been given some new requirements and come up with a whole new seperate problem, lol. Thanks for the help though.
Jul 6 '10 #3
NeoPa
32,556 Expert Mod 16PB
No worries :)

If you have a separate problem you may want to post that too.
Jul 6 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: ML.Steve | last post by:
Hi, There are lots of posts on this subject but after a couple of hours of going though them I still can't get a number of fields to be disabled when a checkbox is ticked. Basically I have a...
4
by: Omey Samaroo | last post by:
Dear Access Gurus, Can anyone provide me with some much needed assistance. I would like to combine the contents of 3 text fields into one field. Can someone provide some code or a method to do...
0
by: velu | last post by:
Problem in storing values from Executescaler() (inside a data grid.) Situation: I have placed a panel inside a datagrid, which populate a table from a database. Now, I run a query to compare...
3
by: Michelle Anderson | last post by:
I have an access form. In the form, it co ntains 3 fields : Type, hours, and Amount. Field "Type" is a combo box and it contains 2 values: Standard and Rush Field " Hours" is just a numeric...
1
by: indhu | last post by:
Hi all, I want 2 know, how to populate using 2 combo box to populate other field. right now am using click event of combo to populate the other field but i want to select both combo1 and combo2 ...
5
by: travellinman | last post by:
Hi, I'd like to make an input mask, based on another field's value. For example, if the value of the other field (in another table) is 125, then i want my input mask to start with 125, subsequently...
4
by: p1tbullz | last post by:
I am an access newbie but i have been searching and can't seem to find a good way to identify values in a single field that are repeated. my field is and i tried using the expression iif( =...
2
by: DeanL | last post by:
Hi guys, I'm using a subform to display a list of values from a single table. The form is showing the values in "continuous forms" view and there will only ever be two different values for the...
3
by: plaguna | last post by:
I'm trying to Count data in a Query Combining two different fields based on the "Date" the product was sold, and for some reason I get a wrong data. When I use only this expression, It works fine:...
2
by: rywags11 | last post by:
Hello, Can anyone help me figure out how to show/hide fields based on information entered in other fields in a form in Access 2007? What I'm looking to do is: When a selection from a drop down is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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
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,...
0
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...

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.