Skip-
Darned if I know. I DO know that I'll have two spreadsheets, one (call it XL_1) just created with TransferSpreadsheet (which has no macros) and another (call it XL_2) that has the macro. I want to run XL_2's macro against spreadsheet XL_1. I've seen this done (and it worked flawlessly)...
Thanks again, Skip. I got that far, but at the point where you say 'now work on... I have to reference a macro in a totally unrelated spreadsheet (one that's not open yet). That's where I'm lost. How do I do that?
Sorry to be such a pain.
Dave
Thanks for your quick reply Skip. Your "IF" is a pretty big if. While I'm comfortable with Access VBA for a standalone database, I'm NOT comfortable referencing Excel objects from within Access.
I think I need to have open my new spreadsheet and also the spreadsheet containing the macro, and I...
I have Office Pro 2003 and am trying to get Access and Excel to play nice but having little luck. In Access I'm using VBA and TransferSpreadsheet to create a new Excel spreadsheet. Now I want to run an Excel macro against that new spreadsheet. Since the spreadsheet created has no macros in it...
Thanks, combo. I'd run across that before but hadn't had much luck with the tests I'd built for myself. I'll work at it a bit more. I figured once I could actually read a comment then I'd worry about where it came from.
Dave
Hi All,
I've inherited an application that makes liberal use of DoCmd.TransferSpreadsheet to transfer Excel data into Access tables. Nothing broken there. Now I need to import Excel cell comments as well. I've found some third-party stuff that claims to do that, but third-party isn't an option...
Hi, jdegeorge,
You might want to stick in a couple lines:
Set rs = Nothing
Set db = Nothing
before you leave your sub just to keep your memory from leaking all over your desk.
Dave
deadfish,
It can be done, and there can be some very compelling reasons to do it. This gets a bit messy. Sorry.
Your combo box will have a downward-pointing triangle at the right with its text box to the immediate left. Let's say the name of the combo box is cboCustomer.
1. Create a new text...
bklyn,
Have you tried OpenArgs?
If
the initial form is [INITIAL FORM] and
[INITIAL FORM] contains a text box named HOSPITALID and
a value is entered for HOSPITALID in [INITIAL FORM] and
clicking a command button on [INITIAL FORM] opens a second form named PRESCREEN and...
A couple suggestions:
a. When you say you released your objects after using them, do you mean you set them equal to Nothing? For example if you use the code:
Private Sub ...
Dim db as Database
Dim rs as Recordset
Set db = CurrentDB
Set rs = dbOpenRecordset(...)
you should follow (at the end...
Dre313, it's not really all that difficult, though it'll be a bit tedious. As I understand it you want a form on which there are several combo boxes. In the combo boxes the user chooses the area, the project,...(probably a lot more things).... You also want two text boxes: one for a start date...
ghost807, seems to me you haven't *told* the code the value of [ID]. How about something like this...
Dim strSQL as String
Dim lngID as Long
Dim ctlSource As Control
Dim intCurrentRow As Integer
Set ctlSource = frm!lstSource
For intCurrentRow = 0 To ctlSource.Listcount...
Dre313, there are a couple of ways to count records:
1. In the query itself, either
a. add a field called TotalRecords calculated as follows:
DCount("[AnyFieldName]", "YourTable")
(note the record count will be the same for each record)
b...
Suggest you omit the second "between". Therefore should look something like this:
between Forms![frm_reportQualityStatus]![txtStartDate] And Forms![frm_reportQualityStatus]![txtEndDate]
or you could use ">=" and "<=" operators such as
>=...
Charles, suggest something like the following:
1. Load a database other than the corrupt one
2. Unhide the database window if necessary and close it
3. Point to Tools|Database Utilities|Compact and Repair Database...
4. Point to the corrupt db and
5. Click Compact
That should do...
How 'bout this:
Private Sub cmdExportToTextFile_Click()
'NOTE: This is attached to a command button
Dim strFileName as String
...
strFileName = "99999999" & Right(CStr([Orders]), 3)
Open strFileName for Output as #1
...
End Sub
That's pretty rough and answers only the file naming...
RoseV: While TPetersonFlorida's response is a good one and may resolve your problems, you might also want to visit the issue of user education (should be fairly easy since there are only six users). Nothing will corrupt a database as fast as abnormally ending execution while it's trying to write...
cghoga's suggestion will work perfectly if the textbox is bound to a field in a table. If you're using unbound controls, you'll need to do a bit of coding. Something like this:
Private Sub MyTextBox_AfterUpdate
Dim strA as String
strA = Left(MyTextBox & Space(250), 250)
MyTextBox = strA
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.