Where do I put it, Sorry I'm slow

trythis

Registered User.
Local time
Today, 12:44
Joined
Jul 27, 2009
Messages
67
So much great information here.

The problem I have is I have implemented several solutions that I have found on this forum.

I still struggle when I find code or figure out code because I cannot figure out....

WHERE DO I PUT THIS!!!

does it go in query field
does it go in query SQL view code
does it go in query criteria
does it go in macro
does it go in table format
does it go in VB module

several times this has been very simple
ex an update query with
Field: tablename.fieldname
Update To:LTrim([fieldname])

What do I need to do to understand this?

I have this code but I am not sure what to do with it to make it work to import a .csv file?????

DoCmd.TransferText acImportDelim, "Import Specification", "tbl1", "C:\Documents and Settings\admin\My Documents\Schedule.csv"

Any help would be great.

Thanks,
Tina
 
Tina,

I find it best when importing data to import into a temp/work table not directly to the destination table.

I use VBA code to run queries and/or use VBA code to clean up the data. Only when it is ready, do I append the data to the final destination table.

In your case, I would import the data into a temp/work table the n run an Update query using the Trim()
 
tina,

You have asked a very good question but I am not sure that I can provide just as good an answer, but I will give it a try.

The best way to approach this is to first consider the context in which the "statements" or VBA code are being presented.

By this I mean, if the current discussion is related to a query then you can normally assume that a solution that someone would post could and should be used in a query. With that said, there can be times when the solution may include some sort of user defined function to do serious evaluation and return the value to a query. In this case the VBA code that defines the function would be placed in a module where it can be access from placing the function calll in the query.

You can normally tell query statements because they will normall start with: "SomeName: XXXXX" and have additional statements following the starting statement or the posted solution may only and an "=" sign starting the statement. One other that you can look for is when an "if" statement is being used in a query it will always be in the "IIF(xxx,xxx,xxx)" format.

On the other hand VBA code will contain some kind of statement like
"docmd.xxxxx" or
If SomeCondition = SomeOtherCondition then

End If

I hope that some of this will be of some help.

Good luck as you learn.
 

Users who are viewing this thread

Back
Top Bottom