I am running a simple excel app within Access. I am opening a new workbook, adding data, formatting the sheet ect. It works quite well the first time I run it (click event). The next time it fails with "Error 91 - Object variable or With block variable not set". Here is the first part of the code and the location where it fails on the second try:
Private Sub CalcPercent_Cli ck()
DELCLARATIONS:
...
User Profile
Collapse
-
Error 91 - Object variable or With block variable not set
-
Nevermind - figure it out. Need Filesystem.Kill per the following:
FileSystem.Kill KillFile -
Why am I getting "Invalid use of property" - Access VBA "Kill"
I am tyring to fiigure outhow to use the Kill statement in VBA. My code is below. I am getting invalid use of propery" error
Private Sub Kill_Click()
Dim KillFile As String
KillFile = "c:\KILL\temp.x ls"
SetAttr KillFile, vbNormal
Kill KillFile
' Kill ("c:\KILL\temp. xls") (Tried this as well)
End Sub
c:\KILL\temp.xl s exists.... -
access report displays number from drop-down vs. text
One thing I was doing inthe report is I was gruping on the "dropdown" control. Once I removed the grouping the content appeared as expected.
ThxLeave a comment:
-
access report displays number from drop-down vs. text
Hi Pat
My problem is not that I want the control to be invisible. I want the content of the dropdown to appear vs. the positional number.
To make the control invisible I could set the visible property to "Not Visible". I need the content to display vs. the positional number. Does that make sense?
ThxLeave a comment:
-
Access Report Displays Number from Drop-down vs. Text
I am producing a report in access. I have a field in a table that is a "Look-up Column". When I add the column to a report it prints out the line-item number vs. the text. For example if I have 3 items in the lookup:
1 Entry 1
2 Entry 2
3 Entry 3
The number 3 prints out vs. "Entry 3". How do I get the content of the column to print vs. the positional number?
Thx -
I am concered about this approach as it is for Access 2000. I am running 2007. This appears to be just what I need, but likely too far down-level.Leave a comment:
-
I want to spawn another version/copy of Access as If I manually double-clicked on the 2nd copy of Access. Does that make it clear? What other info can I provide? thank you for your help.Leave a comment:
-
Thank you for your answer. Using the methods I am using can I access the tables and forms in the external copy of Access? ThxLeave a comment:
-
How to make a newly opened DB (opened via VBA) visible
I have worked through the open syntax to open a database from VBA, but the database does not appear to actually open. Here is the code:
Dim MyConn As ADODB.Connectio n
Dim MyRecordSet As ADODB.Recordset
Set MyConn = New ADODB.Connectio n
MyConn.Connecti onString = "Provider=Micro soft.ACE.OLEDB. 12.0; Data Source=c:\Tools \Test_DB.accdb; Persist Security Info=False;"
MyConn.Open... -
Making the new DB Visible
Thank you removing the ' worked. I think. How do I make the new DB visible?Leave a comment:
-
Next Try VBA Open
This is the code I have now, but I am getting a format error:
Dim MyConn As ADODB.Connectio n
Dim MyRecSet As ADODB.Recordset
Dim strMake As String
Set MyConn = New ADODB.Connectio n
MyConn.Connecti onString = "Provider=Micro soft.ACE.OLEDB. 12.0; Data Source='c:\Tool s\Test_DB.accdb ;Persist Security Info=False;"
MyConn.Open...Leave a comment:
-
Is this what you mean?
Is this is the proper code then:
Dim MyConn As ADODB.Connectio n
Dim MyRecSet As ADODB.Recordset
Dim strMake As String
Set MyConn = New ADODB.Connectio n
MyConn.ConnStr = "Provider=Micro soft.ACE.OLEDB. 12.0;" _
& " Data Source='c:\Tool s\Test_DB.accdb ;Persist Security Info=False;"
MyConn.Open...Leave a comment:
-
How to open Access Database from VBA
I am getting an "invalid database format" error trying to open an Access database from Access VBA. Here is the code:
Code:Dim MyConn As ADODB.Connection Dim MyRecSet As ADODB.Recordset Dim strMake As String Set MyConn = New ADODB.Connection MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\Tools\Test_DB.accdb';" MyConn.Open
-
No go. I am still getting "ActiveX Componenet Cannot Create Object" message. Any ideas? Should I somehow be refering to the worksheet object in the Selection statement?Leave a comment:
-
How to fix object error when creating border in excel spreadsheet
I am trying to create borders in an excel spreadsheet programaticaly using VBA. I am getting an object error on line 2 Selection.Borde rs(xlDiagonalDo wn...
This is my code:
Code:xlWS.Range("F2:J410").Select Selection.Borders(xlDiagonalDown).LineStyle = xlContinuous Selection.Borders(xlDiagonalUp).LineStyle = xlContinuous With Selection.Borders(xlEdgeLeft) .LineStyle
-
-
strReference = A.1.1.3 (for example).
However, I did the following and it worked:
MySQL = "UPDATE ParsingTable SET ParsingTable.Ti er1 = " & intTier1 & ", ParsingTable.Ti er2 = " & intTier2 & ", ParsingTable.Ti er3 = " & intTier3 & ", ParsingTable.Ti er4 = " & intTier4 & ", ParsingTable.Ti er5 = " & intTier5 & " WHERE ParsingTable.do c_label...Leave a comment:
-
First, thank you for the help.
Second, for the variable strReference am I to assume that it also requires "& strReference &"?
When I left it as in your example I still recieved a prompt for input. When I used the "& strReference &" format I am receiving a error indicating I have a problem with '.' '!' or '()". Not sure where to go from here. Can you help?
Thx...Leave a comment:
-
SQL Update
I am attempting to update a table in Access/VBA using SQL. Here is the statement:
MySQL = "UPDATE ParsingTable SET ParsingTable.[Tier1] = intTier1, ParsingTable.[Tier2] = intTier2, ParsingTable.[Tier3] = intTier3, ParsingTable.[Tier4] = intTier4, ParsingTable.[Tier5] = intTier5 WHERE (((ParsingTable .doc_label) = strReference)); "
DoCmd.SetWarnin gs False
DoCmd.RunSQL MySQL
DoCmd.SetWarnin gs...
No activity results to display
Show More
Leave a comment: