How to use Embedded Macro - RunMacro feature
VBA Express Forum » Access Help
by gmaxey
1w ago
I have a command button on a subform whose on_click event is an embedded macro. The purpose is to delete/undo the associated record. After that, I want to run another VBA procedure that is defined in the forms vb object: Code: Public Function RunMacroTest()     MsgBox "A" End Function In the embedded macro definition, I have added "RunMacro" and entered RunMacroTest as the procedure to run. I save everything, exit the design view and test. Nothing happens. How do you run a custom procedure after an embedded macro is run? Thanks ..read more
Visit website
OptionGroup on Report
VBA Express Forum » Access Help
by gmaxey
2w ago
I have an executive level report based on a query (A) that displays a list of project update briefing due dates. This is all well and good provided the staff properly enters the project update due date in the table record. If the due date is not entered then the project (and its required update briefing) is not included in the report. To prevent that, I created a second query (B) that includes both projects with a future due date and project where no due date is defined. I wanted the report to open showing results of query B and include a method to toggle the displayed results between query ..read more
Visit website
Suppressing #Error returned as a query result
VBA Express Forum » Access Help
by gmaxey
2w ago
I have a query that evaluates a record column "Due date" and returns: 1. The week of of the year index and .. 2. The date of Monday of that week: So if I entered July 4, 2024, I get the returned values 27 and Jul 1 However, in some record instances, the "Due date" column is not filled in. When I attempt to query under this condition Name Date Due Mary July 4, 2024 Bob I get 27 Jul 1 #Error These are the two field statements: Code: WeekIndex: DatePart("ww",[DueDate]) WeekBeginDate: Format(DateAdd("d",-Weekday([DueDate])+2,[DueDate]),"mmm dd") So it appears if the DueDate in the record is ..read more
Visit website
How do I edit my vba code so the datas will not be separated in 2 parts
VBA Express Forum » Access Help
by Firied
3w ago
How do I edit my vba code so the datas will not be separated in 2 parts like in the picture, The command is to make all the datas from column A,B,C,F,G,H to be in the same rolls not separated like this ​code.JPG Attached Images code.JPG (98.4 KB ..read more
Visit website
Bug in my code that opens up Excel files from Access to edit.
VBA Express Forum » Access Help
by ry94080
3w ago
Hello all, I have some code that goes in and check a folder periodically and "processes" the file. The code is below: I am periodically getting this error message: "462 The remote server machine does not exist or is unavailable". It doesn't happen all the time. However, when I restart my Access application it processes the file that it was erroring on just fine. I believe it has to do with excel objects being created? It errors on this line: "Range("B3").Activate" Please help. Code: Sub ProcessPriorityCalls(sAffiliatePriorityFile As String)On Error GoTo ProcessPriorityCalls_Err   ..read more
Visit website
How to return a count of related Records and concatenate those records in a field
VBA Express Forum » Access Help
by gmaxey
3w ago
I am way over my head here. A few days ago I posted a question about consolidating and returning a sum of extensions. http://www.vbaexpress.com/forum/showthread.php?71751-How-to-consolidate-and-return-extensions My half a dozen photos I pasted here when I drafted this posts have dissapeared :think: Here is a link to the file: https://www.dropbox.com/scl/fi/2p5wz...wtpo5pcan&dl=0 I have now added another dimension to that project. In addition to tblProjs and tblExtensions, I have added tblIssues ..read more
Visit website
How to consolidate and return extensions
VBA Express Forum » Access Help
by gmaxey
1M ago
The answer to this question may not involve VBA but I'm hoping someone can steer me in the right direction. For simplicity in explaining the issue, I am going to use a simplified example. I have a table of Projects "tblProjects". With "ProjectID" as the primary key and fields "Base_Due_Date" and "Total_Days_Extended" . During the course of the project execution, the Project Manager may request one or more (probably not more than three but just out of interest, lets say unlimited). When an extension is granted, the due date is revised (pushed forward by the approved number of days). So in a q ..read more
Visit website
Embeded Macro Apply Filter using ComboBox.Column(#) value
VBA Express Forum » Access Help
by gmaxey
1M ago
Help with combobox Event>After Update>Embedded Macro>Apply Filter Let's assume that I have a simple (not normalized) query that returns: Action Last Name Datestarted Job 1 Smith 12/1/2023 Job 2 Miller 12/5/2023 Job 3 Smith 12/14/2023 I use that query as the row source for a form. On that form there is a combobox that displays the Last Name of each record. Yes, Smith is listed twice and I understand that is not logical. Please humor me as this is just a basic example and I am only looking for a method to perform a more complex task. When I select Miller in the combobox, I want my ..read more
Visit website
If then in Access Query Expression
VBA Express Forum » Access Help
by gmaxey
1M ago
I have a table (lets call is tblTest) with a role field. For simplicity the roles are A and B. For each record in the table one person performs role A and another person performs role B. In this same table there is an "A Due Date" and a "B Due date" field. In a query, I need as single "Due_Date" field (there is no actual field named "Due Date" in the table) such that if the Role is "A" then the date returned is "A Due Date" and if the role is "B" the date returned is "B Due Date" Something like If tblTest.Role = "A" Then tblTest.A_Due_Date Else tblText.A_Due_Date How would I write this exp ..read more
Visit website
Delete Query with two joins to a Query
VBA Express Forum » Access Help
by ry94080
1M ago
Hi all, I'm trying to create a DELETE query with a table that has two joins to a Query. Is this possible? This is what I have so far but is not working. Code: DELETE *FROM LV_TEST_UNQ WHERE EXISTS     (SELECT *       FROM vMST_Max_NotLV       WHERE vMST_Max_NotLV.AccessionNumber = LV_TEST_UNQ.AccNo AND vMST_Max_NotLV.OrderCodes = LV_TEST_UNQ.TestCode); Any ideas welcomed ..read more
Visit website

Follow VBA Express Forum » Access Help on FeedSpot

Continue with Google
Continue with Apple
OR