Periodically (but not always), I get an error message suggesting that a Form which contains a ListBox is not "Open" when I attempt to access the ListBox. Can someone suggest a test that will ensure that Access is treating the Form as Open - and, if not, will open the form. I use the...
I have two list boxes (lstBox1 and lstBox2) on a form (frmForm1). lstBox1 has three columns of constants that with "RowSource" set equal to "Select * FROM tbl1". lstBox2 has four columns of constants with "RowSource" set equal to "Select * FROM tbl2". I am...
I need to "Calculate" several Excel Worksheets within Access VBA. I can Calculate individual worksheets as follows:
Dim WkBk as Excel.Workbook
WkBk.Sheets("Sheet1").Calculate
WkBk.Sheets("Sheet2").Calculate
But I cannot figure out how to calculate the entire...
I have the following line in a VBA program:
rs.Open "Select * from " & QryTable1
QryTable1 is a string variable that should equal the name of a Query of Table in my Database.
Obviously, I get an error whenever QryTable1 does not match a Query or Table in my Database.
My...
I am trying to set a variable in VBA equal to the number of records in a Query. Do you have to open the Query and use a command like NumRecords = rs.RecordCount, or is there a shortcut that does not require that the Query be opened?
For example: Nz(DSum("Field1", Query(i))) seems to...
I have two forms (call them frm1 and frm2) in an Access Project. On frm1, I placed a command button (cmd1) with the "On Click" property set to "Event Procedure". When I left click cmd1, I go to the Event Procedure called "Private Sub cmd1_Click". When I left click...
Following code results in an error that says "Method 'Item' of object 'Forms' failed". Error occurs on the "Set lstBox..." line.
Dim lstBox As ListBox
DoCmd.OpenForm "frmMktSgmtSelect", acNormal
Set lstBox = Forms!frmMktSgmtSelect!lstMktSgmts
Can someone...
I am trying for the first time to import txt file data into Access by using the Access Menu: File/Get External Data/Import... I cannot get passed the two problems below for two different txt files:
Problem 1: txt file has three columns but Access seems to be reading all of the data as a single...
When I try to save a change in the data type for a Table, I get an error message saying that there is not enough disk space or memory. I have plenty of disk space and memory. Does anyone know what Access is really trying to tell me?
Thank you for any help.
Jim
My macro does not recognize the ListBox (lstBox) that resides on a Form (frmMktSgmt)
I tried the following two codes with two different error messages:
CODE 1:
Dim lstBox as ListBox
DoCmd.OpenForm "frmMktSgmt", acNormal
Set lstBox =...
Can someone help me understand why I get the following error sometimes but not all the time when running the code that also follow:
Error: Method 'Item' of Object 'Forms" Failed
Code:
Dim lstBox as ListBox
DoCmd.OpenForm "frmMktSgmt", acNormal
Set lstBox =...
I have grouped several Queries into a "Group" named "MktSgmts". How would I revise the below VBA Code such that it will only refer to those in the "MktSgmets" Group?
With CurrentData
For Each Qrys In .AllQueries
lstBox.AddItem Qrys.Name
Next Qrys...
Can someone help me debug the below code?
The code works until I get to the line "lstClaims.AddItem Qrys.Name", at which point I get an error message stating "Object Variable or With Block Variable not set".
A ListBox named lstClaims resides on the Form named...
Can someone help me fix the following code that seems to work fine with respect to activating the desired Excel worksheet called "TEST_Agg.xls". I get a "method" error message on the line: Sheets("Agg").select
What I really do not understand is that the variable...
The following suggested macro works great with respect to activating an open Excel workbook when Access recognizes the appropriate Excel instance. Unfortunately, more often
than not, my opened Excel document is apparently in an instance that Access does not recognize. Is there any code that can...
I use an Excel "Add-In" called "VBA ToolPak" that provides access to certain functions not otherwise available in Excel. When I use Access (I believe when I open an Excel document using Access), the Add-In somehow gets disabled. I then have to remove and reactivate the...
vbslammer was very helpful in providing the code that enabled me to open a closed Excel Workbook. Now I need to export data from Access to an already open Excel Workbook. I can't figure out how to get Access to find all open Excel Workbooks. Is there a way to sort through all open Excel...
The following macro opens the table "tblClaimsShort", which has about 170,000 records. Access crashes (my system freezes and Access shuts down) everytime I run the macro - but only after every 10,000 records or so that are properly updated. Can anyone see what may be wrong with my code...
Can anyone suggest why the following keeps giving me a "Type Mismatch" and how I might revise it to activate the Excel file named "MyExcel"?
Set objExcel = GetObject("C:\Documents and Settings\Access Practice File\MyExcel.xls")
Thank you for any help.
P.S. I am...
I have a query with 21 Fields. I added a 22nd Field with an expression:=Field1 + Field2 + ... + Field21. When I attempt to view the resulting Query, I get an error message stating "Expression too complex". Does Access have a Field limit with respect to Expressions? Any suggestions as...
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.