Access World Forums » Modules & VBA
109 FOLLOWERS
Want to discuss vba programming or Modules? Want to tip toe into this area or you're a seasoned expert? This is the place you want to be.
Access World Forums » Modules & VBA
2d ago
Hello, people.
I have this code to export a form to Excel:
Code:Copy to clipboard
Private Sub CmdExportarExcel_Click()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim strSql As String
Dim rsDatos As DAO.Recordset
'Abrimos Excel
Set xlApp = New Excel.Application
'Creamos un libro
Set xlBook = xlApp.Workbooks.Add
'Creamos una hoja
Set xlSheet = xlBook.Worksheets("Hoja1")
'Si hemos filtrado, obtenemos los datos del recordset
If FilterOn = True Then...
Read more ..read more
Access World Forums » Modules & VBA
2d ago
MODERATORS PLEASE:
I tried to attach my database but no matter how small, just the essentials, no data, Zipped and I still keep getting the same error message:
" The Uploaded File Is Too Large "
No zipped is: 14,336 kb
Zipped is: 9,130kb
Good [morning/afternoon/evening] wherever in the world you are.
I am working on a modification on a form my boss wants in our new software.
[This part WORKS fine]
The form is to ADD basic new patient information.
-Works by searching the input data...
Read more ..read more
Access World Forums » Modules & VBA
2d ago
I use Majp FAYT in nearly all my databases. Never a problem. (or at least not THIS problem). Suddenly my code won't compile because this is a user-defined type not defined:
Code:Copy to clipboard
Public faytCategory As New FindAsYouTypeCombo
Right after Option Explicit
I've check all my references and they are the same as in the other databases.
I've put all objects into a new database. Same problem.
I have two forms with FAYT neither will compile.
Surely I'm missing something very obvious here ..read more
Access World Forums » Modules & VBA
2d ago
Trying to get my head around this VBA - This code currently works - but i need to introduce a new charge in my table starting from 01-07-2024 - So i need to change this code to look for the StartDate and The EndDate.
Initial Code
Code:Copy to clipboard
Me.tbRate = Nz(DLookup("Unit_Cost", "TblQCPreRetailSuppliers", "Supp_Code='" & Forms!FrmPreRetailJobs!CboxSupplier & "' AND Forms!FrmPreRetailcharges.tbChargeDate >StartDate"), "")
I have tried
Code:Copy to clipboard
Me.tbRate = Nz(DLookup("Unit_Cost"...
Read more ..read more
Access World Forums » Modules & VBA
3d ago
Hi guys,
just wondering if someone could help me with this below function=
I like to find words starting with AT followed by any digits and the same with DE followed with digits
This is what I got so far..
Code:Copy to clipboard
Public Function ReturnZahlung(strText As String) As String
If strText Like "Überweisung*" Then
mStartPos = InStr(strText, ":")
If mStartPos = 35 Then
mEndPos = InStr(strText, "AT")
If mEndPos > 0 Then
mStartPos =...
Read more ..read more
Access World Forums » Modules & VBA
3d ago
Not sure what happened with my previous attempt to post this but I'll put it in again. I have attached a sample database that illustrates the problem I am trying to solve. This is a main form with a tab control on it. On a tab is a single subform and the goal is to update the Caption of the tab so it shows the record count in real time when records are added or deleted.
Adding new records seems to work, but when they are deleted, the record count does not decrement. Its like an order of...
Read more ..read more
Access World Forums » Modules & VBA
3d ago
Hello and thank you in advance for any help you can give me.
I was recently converted to Office 365, and as a result, DoCmd.TransferSpreadsheet no longer trims trailing spaces from field names.
I have a database that imports a single file from a client. (Please see form code below.) The filenames are never the same, so I don't believe linking instead of importing is an option.
There is one field name in the client files that sometimes has a trailing space and sometimes doesn't. (Asking...
Read more ..read more
Access World Forums » Modules & VBA
4d ago
I need to have a user select a file for further operations using a normal dialog. I tried this code, but nothing happens, not even an error.
Code:Copy to clipboard
Dim FileName As String
Dim FD As FileDialog
Set FD = Application.FileDialog(msoFileDialogFilePicker)
FileName = FD.InitialFileName
I have the Microsoft Office 16.0 object library in references. Is there a better way to do this ..read more
Access World Forums » Modules & VBA
4d ago
Continuing saga of my horse racing project.
I am using Access 2010 and Excel 2010.
I have attached a small database with a table and 2 queries.
'Table1' has the following fields:
MtgDate, Race, Margin (in metres), Rate
For each Race I want to get the average Rate for Top 6 Horses that finish within 'x' metres of the winner (including the winner)
For different Meetings and Race types, 'x' can vary between 4m and 7.5m
Using Query01 I can get the Top 6 (or less) Horses that finish within 'x'...
Read more ..read more
Access World Forums » Modules & VBA
4d ago
My current project requires some user defined colors to be entered into the form. The form allows for the generation of custom reports. These colors adjust a Reports title font and some other controls as well. The problem that I need to solve is how to take any of those colors entered and calculate the lightest shade that can be produced for that given color. This calculated value will be used to set the back color of the RptTitle control on the report based on the entered color for the...
Read more ..read more