User Profile
Collapse
-
Fantastic! it works! thanks for your help on this. You can probably tell I am a begineer on this VBA stuff. I wish I could get better at it but there doesn't seem to be much text on the subject can you recommend anything?... -
You are exactly right in what you say. I don't know the code though. Here is the full code I have at present.
[CODE=vb]Option Compare Database
Private Sub UpdateDatabase_ Click()
DoCmd.SetWarnin gs False
' Selects tbl_01_BKUK_Act ive&Withdrawn and deletes previous download
DoCmd.OpenTable "tbl_01_BKUK_Ac tive&Withdrawn" , acViewNormal, acEdit
DoCmd.RunComman d acCmdSelectAllR ecords...Leave a comment:
-
Access Run Time Error 3011
In my access database I have created vba which deletes information in a table and then uploads a .txt file based on it's naming convention.
However if you specific an incorrect naming convention by mistake the vba still deletes all the information in the table so the table is blank and nothing is uploaded.
The next time I try and run the code i get run time error 3011 because there is nothing to delete in the table.... -
Unfortunately it still does not work. Whenever I try and refer to a cell on the workbook it does not connect to outlook. Strange!
Regards,
Forrest...Leave a comment:
-
-
I'm sorry I am not very strong with VBA I am not quite sure what I need to do?...Leave a comment:
-
Unfortunately i still can get this to work. Do you know if you can definiently reference a cell with the .Send mail function?...Leave a comment:
-
I don't know why this does not work I don't get an error messgae but the code does not connect to outlook. below is the VBA I now use with your suggestion:-
.SendMail ActiveWorkbook. Worksheets("She et3").Cells(2, 1), _
full code below. Am I doing something wrong?
[CODE=vb]Sub Mail_ActiveShee t()
'Working in 97-2007
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim Sourcewb...Leave a comment:
-
Unfortunately this did not work but thanks for your reply....Leave a comment:
-
Send Attached excel sheet to varied email addresses
I am currently trying to create VBA to send a specified excel sheet to varied email sources. I currently have the code below which sends the attachment in an email to a specified source e.g. mrqwe@hotmails. com, however I want to change this so the address is chosen from a specified cell on a worksheet. I have tried to reference a cell e.g. .sendmail Sheets("sheet3" ).range("A1"),_ but this does not work. Any ideas anyone?
... -
-
I have tried to add in a blank row etc but I am getting a runtime error 2147467259....Leave a comment:
-
Filter by value expressed in a cell not in the VBA
I have the following code which pulls the results of a table in Microsoft access into excel. Currently the code filters the results from within the code, however I would like to filter the results by the vaule expressed in a cell.
[code=vb]
Option Explicit
Sub ADO_Demo()
' This demo requires a reference to
' the Microsoft ActiveX Data Objects 2.x Library
Dim DBFullName As String... -
The code above pulls in one query, well actually one table 'table1', but lets say I also want to pull through 'table2' and 'table3' onto the worksheet and separate the results by a blank row??
I.e. I want to pull through 3 tables onto 1 worksheet and separate the results by a space.
Regards,
Forrest...Leave a comment:
-
Cheers for this i will look through this I really am trying to understand VBA but it looks so complex and I just do not know where to start.
Regards,
Forrest...Leave a comment:
-
I have got it to run! here is the full code. I also needed to swuitch something on in the reference table.
Public Sub GetCn(ByRef dbcon As ADODB.Connectio n, ByRef dbrs As ADODB.Recordset , _
sqlstr As String, dbfile As String, usernm As String, pword As String)
Set dbcon = New ADODB.Connectio n
dbcon.Open "PROVIDER=Micro soft.Jet.OLEDB. 4.0;Data Source=" & dbfile & ";", _
usernm,...Leave a comment:
-
No=, unfortunately I need to script and automate excel. I have seen it done before . Icant find any descent books on the subject....Leave a comment:
-
Export Multiple Access queries to 1 excel sworksheet
I want to be able to export multiple access query results to 1 excel worksheet so the results appear under each other.
I need this to show the results of headcount, leavers and starters in a cost centre. I do not want to have to run 3 separate reports on 3 different tabs. I want them all on 1 tab and under each other.
I can run vba to pull 1 query at a time but I can't find what I need for the above. Can anyone offer... -
I am currently running this VBA in excel to try and pull the information from access....Leave a comment:
-
Compile Error: User Defined Type
I am currently trying to use the below VBA to import information into excel from access. This VBA is in the excle sheet:-
...Code:Public Sub getrs() Dim adoconn As ADODB.Connection Dim adors As ADODB.Recordset Dim sql As String Dim filenm As String sql = "Select * from Table1" filenm = "R:\HR\HR_System_Reports_Folder\Databases\HeadCount.mdb" Call GetCn(adoconn, adors, sql, filenm,
No activity results to display
Show More
Leave a comment: