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

Need to repeat records

tlove1966
Hello everyone...I have a table that looks like this:

CustNo / BullCode / Doses
123456 / 123HO3214 / 3
321654 / 654JE1245 / 5
456789 / 478AY6549 / 10

and so on.

What I am trying to do is for each record that shows more than one dose as above, I need to repeat that line to match the number of doses

For example the first line I show you here needs to look like this when I'm done:

CustNo / BullCode / Doses
123456 / 123HO3214 / 3
123456 / 123HO3214 / 3
123456 / 123HO3214 / 3

Quite honestly at this point, I no longer care about the number of doses, I just need it to list it 3 times....

I'm certain there must be a way...Any assistance is greatly appreciated.

TL
Oct 15 '07 #1
4 1399
Rabbit
12,516 Expert Mod 8TB
You'll need to do some VBA coding, where do you stand on that?
Oct 15 '07 #2
I stand in the dark... :-)
Oct 16 '07 #3
Rabbit
12,516 Expert Mod 8TB
Well, first you'll want to find a VBA tutorial and start learning the basics. After that, what you'll want to do is:

1) Open up a recordset that uses SELECT DISTINCT so you don't get duplicate records.

2) Use a Do Until recordset.EOF to loop through all the records.

3) Use a For i = 1 to recordset!Doses to loop the next command x times where x = number of Doses.

4) Use a DoCmd.RunSQL "Insert ..." to insert a copy of the record.

5) Increment the recordset.

So, read up on VBA, test out some stuff, and once you get started, we can help you through any implementation issues you have.
Oct 16 '07 #4
Great...thank you...I'll see what I can come up with....
Oct 16 '07 #5

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

Similar topics

12
by: jason | last post by:
Access 2000: I have a customer-inventory table I need to loop through and compile a list of all the inventory items the customer is tracking. The problem I am finding is that a simple loop...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
0
by: Miguel Dias Moura | last post by:
Hello, I am displaying some content on a web page like this: <div id="content"> <div id="main">...</div> <div id="contacts">...</div> </div> The information is organized using the 2 div's...
3
by: Meena | last post by:
Hi Every Body, I have created a crystal Report and linked to my vb.net forms and working fine, I added more drill drowns in groups everything fine, but What I need is I am not able to display...
2
by: gjoneshtfc | last post by:
Hello, I want to create a table with records from a database but I want the background colour of each row to be different. For example: Record 1 - blue background Record 2 - white background...
1
by: Alan | last post by:
I just installed MS Access 2002 on a new PC. On my old PC when I had a form up and held the mouse down on the backward and forward arrows to change the record, the records would fly by due to the...
4
by: Tom | last post by:
Hi: I'm having a problem with a simple report in a simple database. Basically it's an issue tracking database - what is the issue, what is the proposed solution, who is responsible, a tracking...
2
by: nityaprashant | last post by:
Hello.. i have template column & i want to show two (2) records in one row. for that in datalist one property repeat column but is there any property in gridview? is there any other way to...
2
by: jdvictor | last post by:
Understandably I know that the real issue is in IE but at the moment everything looks good in IE and not Firefox. THE PROBLEM The problem that I am having is that my navigation menu is out of...
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:
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: 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
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...
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.