I am trying to assign archival id in my database to the corresponding file number column through an Excel userform. It should find the largest alphanumeric string in the column, and increment it by 1 …
Tag: vba
Selecting additional data/values to display as column in query or in form
I have an employee index, that I need to run queries on for each employee, and display that output along with the original employee. So say the employee index has an ID, batch, status, and multiple other columns. I have a table where I keep track of every time a column in the employee index changes. I want to display
Populate listbox from access file
I have found a piece of code that enables me to list or populate listbox based on access database When trying that I encountered an error Type data mismatch in criteria expression at this line rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic, adCmdText Answer Your table got a field related to a secondary table (let’s say it’s called tblGender). If the primary
VBA 3131 error in SQL using variables in query
Can you please help me? I was trying to figure it out for about 2 hours but I still have some error in the syntax. I have the following code with String variables which I need to pass into the SQL …
How to retrieve data from other Excel using VBA and SQL?
I have a problem with my code. I tried retrieving data from other Excel file. My code works but I received full data in one cell (A1). I’m sorry but I’m just beginner, believe that’s the problem related to output, but I’m not find out why: Answer No need to wrap recordset values wtih semicolon delimiters using a Do loop.
Microsoft Access “User-defined type not defined”
When trying to run the following code, I’m getting an error when it hits Dim qdf As QueryDef saying User-defined type not defined I think it’s really weird because I have a backup of this same project in which not many changes were made after it which is working completely fine for this. I’ve tried to retrace my steps and
VBA throws an error when picking up cell values into SQL query
I get the following error when picking up values for my SQL from certain cells. However, when i hard code the values into the code, it works fine. so, it’s clearly something to do with the syntax of …
SQL string in access VBA not behaving as expected
I have a bit of access VBA that for the life of me, I cant work out what is wrong. First off, here is the offending section of code, and I’ll explain what I want and what it’s doing below. …
Excel VBA – ADO Connection to MS Access DB – Filtering results
I have a MS Access Database where I store some information of products and I have these fields: ID, Customer Part No., Description, Price, Observations I also have an Excel file where I have a column called Customer Part No. and in this column I paste the Customer’s Part I want to filter. I need a way to make a
Return a string using the month part of a date field
I am trying to create a query which populates the salesPeriod field from the salesDate field. The query should return a string value based on the date part of the salesDate. The conditions are: If month is equal to equal to 11, 12, 1, return “Christmas Sales” If month is equal to 6,7,8 return “Summer sales”. Otherwise return return “N/A”