 |
| Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 16th, 2006, 09:23 AM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, i'm so use to doing conn.execute that I often forget about adding records that way. I need to mod it alil then I'll get back to you on how it works... you are a big help. Thnx
|
|

May 16th, 2006, 09:25 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
I am still not clear on the structure of the data, though. If each #-@ is a seperate reading from the wrench, then each line would have multiple records, instead of each line having one record. So that makes a difference in how you shove the data into the table. Please clarify.
mmcdonal
|
|

May 16th, 2006, 11:49 AM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Cna I count the amount of arrarys there are that have values?
intx = arrary(x).count or something like that?
|
|

May 16th, 2006, 11:57 AM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by mmcdonal
I am still not clear on the structure of the data, though. If each #-@ is a seperate reading from the wrench, then each line would have multiple records, instead of each line having one record. So that makes a difference in how you shove the data into the table. Please clarify.
mmcdonal
|
I wish I can contructed the data file myself but the engineers here are using a generic hyperterminal app called Tera Term Pro. It logs data in one long line. Then they call me and tell me to make heads or tails of it. Max measurements should be 20 hopefully. If I could attach the file so you could see it I would.
|
|

May 16th, 2006, 12:03 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
You use UBound(MyArray) which returns a numeric value of the number of elements. Remember to add 1 since it starts at 0.
So if UBound(MyArray) = 2, there are 3 elements: 0, 1, 2.
mmcdonal
|
|

May 16th, 2006, 12:40 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What I need to know is, in the first line that you showed me, what will you be storing and where?
mmcdonal
|
|

May 16th, 2006, 12:51 PM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'll be storing Torque values and in an access database for weekly reports on value that where torqued High/Low.
|
|

May 16th, 2006, 01:01 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
I get it. You will then need to store the date and time the data was retrieved. Are any of the values in the data date and time stamp data? Which part of the data is torque spec, wrench id, date and time, if any? That would be ideal. Otherwise you will just stamp the time the process was run.
mmcdonal
|
|

May 16th, 2006, 01:16 PM
|
|
Authorized User
|
|
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The app called Tera Term that actually gets the data from the wrench stores the data for each wrench in a diff file. IE: Toola, Toolb, Toolc. The form I'm creating will add generate a random record ID and store the record for each transmission in Table Toola, Toolb, and Toolc all with same record ID and date/time stamp.
|
|

May 16th, 2006, 01:29 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
So what you will need to do is to create a table with an autonumber field, the data field from the file, and the date/time. So Toola table should look like this:
tblToolA
ToolaID - auto: PK
Data - text: 12005055.00000000441526
DateTime - date: Now()
Also, it sounds like each line has, in this case, 12 records. So the line you posted needs to be split into 12 parts, then each of those 12 parts has to have its own record, with PK, data, and datetime. If that is the case, then the code I posted needs another nested loop.
Are we getting closer? It is all very easy if we have the requirements right.
mmcdonal
|
|
 |