Need Help with Programming

G

Guest

I have done a little bit of coding, but I am not totally familiar with the
syntax for Access, nor the setting up of a module. I am taking a dos
database and upgrading it to Access so that it can run smoothly on an XP
computer. All the tables and relationships are set, and so is the
switchboard interface with Macros. However, there are a few things I need to
learn for programming purposes.

1) I need to have a temporary storing unit (temporary database) that uploads
the information into the main database at the end of each day after
inspection.

2) During this upload I need to parse some digits out of a field, (example
XXXXABCD) ,where the ABCD would be parsed to trigger a round trip mileage and
add it to the units current mileage. The last four digits indicates the
route and it is linked to a database that holds the round trip mileage.

There will probably be more to code, but I am hoping that whatever help I
get with this will enable me to understand it enough to figure out most of
the other stuff needed. Thank you very much and have a great day!
 
R

Rick B

One observation...

Why copy and paste data and get a temporary database involved? Just add an
"approved field to the record and check it off after inspection. Exclude
all the uninspected records from your standard queries and reports.

To get the ABCD just use the Mid or Right Function.
Right([SomeFieldName],4)

Rick B
 
G

Guest

There shouldn't be copying and pasting... it will be more like click the
button, upload the results. Each time it is ran, it will update the number
of miles, so it is tied to #2.

As far as coding, is that what I would type in the module? What if it is
from a different table, etc.?
1234ABCD is in one table, and miles per round trip are in another table


Rick B said:
One observation...

Why copy and paste data and get a temporary database involved? Just add an
"approved field to the record and check it off after inspection. Exclude
all the uninspected records from your standard queries and reports.

To get the ABCD just use the Mid or Right Function.
Right([SomeFieldName],4)

Rick B



Brad_A said:
I have done a little bit of coding, but I am not totally familiar with the
syntax for Access, nor the setting up of a module. I am taking a dos
database and upgrading it to Access so that it can run smoothly on an XP
computer. All the tables and relationships are set, and so is the
switchboard interface with Macros. However, there are a few things I need to
learn for programming purposes.

1) I need to have a temporary storing unit (temporary database) that uploads
the information into the main database at the end of each day after
inspection.

2) During this upload I need to parse some digits out of a field, (example
XXXXABCD) ,where the ABCD would be parsed to trigger a round trip mileage and
add it to the units current mileage. The last four digits indicates the
route and it is linked to a database that holds the round trip mileage.

There will probably be more to code, but I am hoping that whatever help I
get with this will enable me to understand it enough to figure out most of
the other stuff needed. Thank you very much and have a great day!
 
A

Albert D. Kallal

Brad_A said:
There shouldn't be copying and pasting...

Well, then why are you asking for a routine to copy/upload some data? While
the poster mentioned pasting, the poster also inferred "copying".

The question is being asking in sense why "copy" a bunch of data at the end
of the day, when it may be FAR easier to simply have a field so some value
(in this case "approved" field). The whole point being made here is that if
you can avoid some big processing and copy process..then you should!!
it will be more like click the
button, upload the results.

Upload the results to where? Are we now talking about separate databases
here? Or remote database? Or perhaps notebooks in the field?

It is not clear if you are taking about two complete and separate systems
that must talk to each other. Or, are you simply talking about ONE database
system here? (and, thus we are now back full circle to the issue of
"copying" data..and do we need to?).
As far as coding, is that what I would type in the module? What if it is
from a different table, etc.?

You have the full Visual Basic programming language in ms-access. You can
write pac-man game in ms-access if you want. However, you will have to
learn, and have some coding experience here to accomplish this. In fact, the
question is no so much "what" you would type in a module, but in fact how
the code will be executed. (perhaps you make a form, and prompt the user?).
If the code routine to run the update is small, then you likely would be
better to put the code in a forms module, then that of a standard module.
1234ABCD is in one table, and miles per round trip are in another table

You can open, and process data from many tables in code. I think you will
need to do a bit of leaning here if you are need to programming in Visual
Basic.

The basic code to traverse a table is

Public Sub ProcessData

dim rstRecs as dao.RecordSet
dim strSql as string


strSql = "select Milage,MilageDate from tblMilage order by MilageDate"

set rstRecs = currentdb.Openrecordset(srSql)

do while rstRecs.EOF = false
debug.print "odom reading = " & left(rstRecs!Milage,4)
' other code to process can be placed here
rstRecs.MoveNext
loop
rstrecs.Close
set restRecs = nothing

end sub

The above is "air" code, but gives you the basic idea of how code would
look...
 
G

Guest

What would I have to do to tempt you??

I can beg if you want??

Please...pretty please...pretty please with a cherry on top!!
 
A

Albert D. Kallal

You can make a pac-man game?? Are there any examples of this??

Don't temp me....I might just have to write one to show this!!! It would be
a LOT of fun to write this, and in fact I would use a standard form to make
each level!!!...
 
D

Dirk Goldgar

cdb said:
What would I have to do to tempt you??

I can beg if you want??

Please...pretty please...pretty please with a cherry on top!!

There goes Albert's productivity!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top