PDA

View Full Version : Access Help?



Trany
02-21-2010, 09:47 AM
I am making a reporting database at work, and am having a hang up with one issue.

I have a button that runs several macros; deleting, creating, and appending tables. It is the standard even, on click to run the macros in order. This is multi user report tool ,that will need to be updated, with the new data. I would like to add a line of code? that when the button is clicked to basically timestamp a text field to mark it as when it was updated.

I was thinking coding something like:

on.click "text field" = Now()

The next issue i am having is updating my sales data into tables, The macros, create "master" lists for the customers, for products ordered and sold. I have the UPCs as the reference field, but I also have several customers, so its a 4 digit corp code, then a 12 digit UPC.

I have sales data as column headers, IE current weeks sales, last weeks sales, 5 weeks ago, lifetime dollars, etc.

I would like to update the table with any data that is not 0 or null. I would have to run several, queries to update all the customers, but I can import the data, and have several macros.

I hope I am being clear enough, to get some help.


Let me remind you I am 100% self taught, and not a programmer in any capacity, this is way out side of my skill.


Thanks,

Trany

Trany
02-23-2010, 06:46 PM
OK, thanks for no help, but it took me 4 hours and I figured it out. Now in playing in the VBA stuff, if I mess something up its going to explode, and a small African nation will die.

I need to be able to call the modified date of the Access object for some date arithmetic. I believe I can do this with an API command, but I am looking to be able to set a range, where I cannot update the field.

I will also state that I work with people who will fuck this up on epic proportions if I don't create fail safes in the beginning.

Thanks in advance,

Trany

Naya
02-24-2010, 03:54 PM
You can't use a GetDate() function? I'm not big on VB, but I'm getting better with my SQL every week ...

Trany
02-24-2010, 07:23 PM
I can, sort of. I want to call out for the last modified date, I don't think access really likes to referance its own files. So I might just write some code to export the file, and if its in range x-y then not update it. in and out with data.

Naya
02-26-2010, 08:45 AM
Access is kinda stupid that way; its not meant for large databases and isn't a very robust piece of software. Its nice for simple data storage and reporting back on that data, but forget trying to do something constructive with any of it.

I'd export to Excel and see if you can write something in VB to pull a date range with a time stamp. I wish I could write some code to give you an example, but its been about a year since I was in a VB class and so I haven't used it since.

Klaus
02-26-2010, 09:07 AM
Trany I asked Michelle last night and her brother Jim knows access and sql really well.

Hauser
02-26-2010, 10:37 AM
I can probably help you Trany. Find me online. I just had to write some queries in access this week that export to excel based on a start and end date you type in. I am sure I can figure out your timestamp stuff. As long as your data has a time or date field, we can have it export a range. I dont care whether it exports to another access table or excel.

Trany
02-26-2010, 01:07 PM
I solved it it was a mapped network drive namming issue. Now I want to know if it is possible to bind Ctrl+P in access VBA.

Trany
03-04-2010, 08:36 AM
I am trying to paste several ranges into a word doc from excel.

here is a snipit of code:


Range("A71:D87").Select
With Selection
Selection.Copy
wrdDoc.Range.Paste
End With

Range("A90:D106").Select
With Selection
Selection.Copy
wrdDoc.Range.Paste
End With

It pastes to word but every range that is copied is pasted over the prior.