473,406 Members | 2,698 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,406 software developers and data experts.

posting data from one record into the next record

39
I am using Access 2003.

I have a form that has text boxes labeled Position 1 T1, Position 1 T2, Position 2 T1, and Position 2 T2. When I create a new record, I want the same values to save into the new record unless a yes/no check box is selected on the new record (I also would like to gray out the entry altogether for update unless the check box is selected-that I found). I have looked all through the properties and can find no way to do this.

Any help is greatly appreciated.
May 26 '09 #1
14 1837
Arli
39
I just had a thought on this (do not know if it would work):

I think I could place a button on the form that would first record those fields as a number (i.e. numP1t1, numP1t2, numP2t1, numP2t2), then move to a new record and place those variables into the correct fields. I can gray out the area by using an IF statement on the check box.

Would something like that work?

Thanks
May 26 '09 #2
NeoPa
32,556 Expert Mod 16PB
A way to do this which would not be clumsy and not set the Dirty flag, would be to handle setting the defaults for the various controls depending on the CheckBox you mention.

A default value only ever has an effect when the record is created.
May 26 '09 #3
nico5038
3,080 Expert 2GB
There's a nice working sample database in the Access CookBook:
http://examples.oreilly.com/accesscook/CDROM/chap09.zip
The fifth sample (0905.mdb) is the one you need..

Can recommend the book :-)

Nic;o)
May 26 '09 #4
Arli
39
That worked! Thanks for the help. I used the exact code from your example and a checkbox to clear it when needed. I also went out and got the book.

Arli
Jun 1 '09 #5
nico5038
3,080 Expert 2GB
You're welcome.
Always great to see that people want to improve their skills :-)

Nic;o)
Jun 2 '09 #6
Arli
39
I have one more question. I used the code almost verbatim from the example (chainging the names where needed). I was wondering if there is a way to do the same thing by tying multiple values to the same toggle switch? What I want the operators to be able to do is select the toggle switch and that one switch would pull all the data forward into the new form.

Hopefully that makes sense.

Thanks
Jun 2 '09 #7
nico5038
3,080 Expert 2GB
Hi Arli,

In case of multiple (excluding) values the general approach is to use a frame with radio buttons, one for each value. Such a frame (see the toolbox symbol with the square and text top left) with round radio buttons will be an intuitive way for the user to select a value and the frame can be bound to the field holding the value.

Getting the idea ?

Nic;o)
Jun 2 '09 #8
Arli
39
I will give that a try. Another thing to note (I was just testing the form). The code pulls the data from the first form forward. I set the toggle buttons so that the operators cannot change them, then put a check box on the form to clear those fields if new data is required. When I check that, it clears out the fields and allows the input of new data. The problem is that now the code appears to not work (when I create a new record at this point, the old data from record 1 is pulled into record 3).

That is the reason for the previous question. Using radio buttons may help me on that (because I need two checkboxes).
Jun 2 '09 #9
nico5038
3,080 Expert 2GB
Keep me posted. When you find no solution, then attach a small sample .mdb so I can check the form. (Use the [Edit] after posting your comment to add an attachment)

Nic;o)
Jun 2 '09 #10
NeoPa
32,556 Expert Mod 16PB
@nico5038
That's no longer necessary Nico.
To attach items to one of your posts you need to scroll down the page a little when posting (either originally or in an advanced edit screen) to the button that says Manage Attachments. Pressing on that leads you to a page where you can add or remove your attachments. It also lists the maximum file sizes for each of the allowed file types.
Jun 3 '09 #11
Arli
39
Here is a copy of the database. In the form, I disabled the toggle buttons because I want to pull the data forward until the NewSetup check box is selected. As it works now, when I enter data into the first record, it pulls it to the second record. Once I input the second record, I go to the third (it still pulls forward the data-but I think it still getting it from the first record). On the third record, I select the checkbox for the NewSetup, that then clears the data (but does nothing to the toggle switches). I input my new data. Click on new record (which should then pull the new data forward), and the fourth record shows data from the first record still. If you want to try it out, use the following data.

Select New Work Order
then enter anything for Part number
enter anything for Serial number
check that the box exhibits 100% coverage
Leave the pulled forward data in there.
enter a number for machine timer
enter a number for both badges.
click new work order

On this one, select the checkbox for First Part on new setup.
then follow the above instructions and enter numbers into the Position1T1-Position4T2 fields.
click new order.

It should pull forward the 1.1234 from the first record.

Sorry if I am to detailed in this. I want to duplicate it exactly.

Thanks for your help.
Attached Files
File Type: zip ShotPeen.zip (103.2 KB, 73 views)
Jun 3 '09 #12
nico5038
3,080 Expert 2GB
Attachment ?

:)

Nic:o)
Jun 3 '09 #13
Arli
39
I could have sworn it was there....yea, right. Doh!
Jun 3 '09 #14
nico5038
3,080 Expert 2GB
The present mechanism will "store" the value that's present in the text field when the toggle button is pressed. Changed values won't change this default value. Only a deselect and selecting the toggle again will set the newly entered value to being carried forward.
When you want to carry forward the last entered value, then an additional function is needed that handles the AfterUpdate event of the text value.

I've created such a function and applied it to the first field "POSITION 1 T1" by adding the function call to the AfterUpdate event and placing the toggle name in the tag property. Guess you can handle the remaining fields :-)

Nico
Attached Files
File Type: zip ShotPeenNico5038.zip (40.2 KB, 80 views)
Jun 3 '09 #15

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

Similar topics

9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
4
by: Claudia Fong | last post by:
Hi, I have a form where I need to display the data of a department that stores in a access db. When I first load the form it will call a function name loaddata which will get the first...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
1
by: tony.fountaine | last post by:
I am working on a project to read a Bosch Measurement Data File (MDF). The file contains a number of blocks that can be read from the file using a baisc structure. For example the ID BLOCK is as...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
2
by: mfaisalwarraich | last post by:
hi everybody, im new to vb.net and have googled around for moving to next record. i connected a MS Access Database using data source in Visual Studio 2008. im using the following code. ...
11
by: dizzydangler | last post by:
Hi, all! I'm a new user, looking to get some help on a form problem in MS Access 2007 I haven't been able to crack. I've built a form that prompts users to enter new record data, then click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
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...
0
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,...

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.