473,386 Members | 1,860 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,386 software developers and data experts.

How to move to next record that isn't based on key id?

16
I have a form that operators fill out every time they finish a sample for a particular batch. We do test multiple samples for each batch but the number of samples vary depending on certain criteria.

In the form, I have placed a sub form of the table that the data in which hold this information so its being directly entered in. The operators are able to put all the samples connected to that batch right into the sub form. Naturally, when you look at the table all the data is there and the batch number connected to all the samples.

The problem I am running into is every time I want to cycle through the data, on the form, I need to click as many times as there are samples to get to a different batch number.


Example:

Batch Number: 206 has 7 samples
I need to click back 7 times to see data for btach 205. How can I have form move to the next record based on the batch number?

By the way, I programmed my own buttons so I use the DoCmd.RunCmd acCmdGoToNextRecord instead of the default buttons.
Jul 17 '14 #1
7 1277
Seth Schrock
2,965 Expert 2GB
I'll admit I'm a bit lost in your Form, Subform, Table, etc. description to know what data is where. But based on your problem, it seems the simplest setup would be to have a main form with your batch info on it and then have your subform have the samples data. If your subform is linked (master/child) to the main form, then every time you change the batch in the main form, then subform data will refresh to the samples for the new batch.
Jul 17 '14 #2
jimatqsi
1,271 Expert 1GB
devarts,
Be aware that you can use parameter values acLast, acFirst,acNewRec instead of acCmdGoToNextRecord. You don't have to step through one at a time.

But also you can put a button on the main form instead of the sub-form in order to change batches instead of changing samples within a batch.

Jim
Jul 17 '14 #3
devarts
16
I've attached a database that only concerns the issue at hand. I hope this might clear up a few thing. If you hit the previous button you'll see what I am talking about.

Dylan
Attached Files
File Type: zip Gen3 Database_Bytes-accdb.zip (211.4 KB, 65 views)
Jul 17 '14 #4
Rabbit
12,516 Expert Mod 8TB
As a rule of thumb, we do not download attachments from people we don't know. It's better if you describe the question as clearly as possible and post any code or error messages you may be getting.

From your first post, it sounds like you don't have a batch table with a listing of distinct batches. That's what you want for the parent form, a listing of distinct batches. If you don't have such a table, you should probably create one for normalization's sake. But if you can't do that, you should at least change the parent form's record source to return just the unique batch ids.
Jul 17 '14 #5
devarts
16
I apologize; I didn't know. And I can't have a table of batch numbers because we receive the batch numbers from our supplier, so it could be any number.

But I'll take a look at the sub form and see what I can do.
Jul 17 '14 #6
Rabbit
12,516 Expert Mod 8TB
You receive the batch numbers. That doesn't mean you can't enter the distinct numbers into a table. It also doesn't mean you can't change the record source of the parent table to return the unique batch ids.

Who sends you the data and how they sent it shouldn't affect your ability to store it differently or interact with it differently than how it was sent to you.
Jul 17 '14 #7
twinnyfo
3,653 Expert Mod 2GB
devarts,

I htink you need abutton on your main form that cycles through batch numbers, then filters the subform based on that batch number, listing samples 1-x.

I did not download your DB, but this is relatively simple to set up. Your main form would house data for the Batch Number and the subformhas the sample info, also with the Batch number. Establish the Master/Child link field to Batch number and all should be well...

Hope this hepps.
Jul 17 '14 #8

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

Similar topics

15
by: Susan Bricker | last post by:
Greetings. I have a Mainform with a subform. The Mainform has single record format and subform has continuous form format. When the Mainform opens, I force allowadditions and allowedits to FALSE...
2
by: Anand Ganesh | last post by:
Hi All, How to Implement Move Next, Move Previous, Last Record and First Record in a DataGrid Control ? Is there any standard tool available in the tool box button? Thanks for your time. ...
2
by: bhipwell via AccessMonster.com | last post by:
I need to put a button that allows the user to move to the next record. On the form, I have a list of employees that are filtered by the company they work for. Obviously, if I use the simple...
3
by: dianaj86 | last post by:
I have multiple dropdownlists each one filled with values from a specific column in the table. Also I have multiple textboxes corresponding to dropdownlists. For example, when I select an item from...
10
by: ewankosayo | last post by:
Hi can anyone help me how can i move to the next record? While Reader.Read For Each Row As DataRow In Table.Rows If Reader("UserID") = Row("UserID") Then ...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
3
by: Lynx101 | last post by:
I am trying to move a subform onto the next record with: DoCmd.GoToRecord acForm, "MaintainAssets_edit", acNext but when I do this I get "The object 'MaintainAssets_edit' is isn't open". I...
4
by: doxtor | last post by:
Dear all.. I try to make an inventory control, with FIFO(first in first out) base, but I have a problem with the next record. this is the code i make : $db = new clsDBMassimo; $product_id...
0
by: solargovind | last post by:
Hello, I have few problem with Dlookup condition. I need to retrieve next record or previous record based on certain condition. The conditions are set in in the combo box. Here, I am trying to...
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. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
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...
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
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.