I’m working on a DB where I need to search MAX(ID), where ID is an autonumber, (basically the most recent record/last record) and then when found I want to get the receipt number. e.g. receipt table …
Tag: vba
SQL query to get the Sum of all column values in the last row in access table
I have a table like below. I want to sum parts column and write the total after the last record. how to specify total and the result in SQL query. Answer Try this query
What is the best SQL statement to query a table using Excel 2010 VBA with ADO (or vb.net with LINQ)
Table Name: employees Right now I am stuck on trying to figure out how to combine two of my SQL queries into one. Query #1: SELECT * FROM `employees` WHERE `name` = ‘BOB’ …
Undefined variable at ‘Incdntno.Value’
I am having trouble getting this to compile, it keeps giving an undefined variable error during compile at ‘Incdntno.Value’. I tried to Dim Incdntno as Integer but then was getting Invalid qualifier. I have a similar code that works (see second code block). I didn’t need a lot of what was going in the working code part so I removed
Incorrect syntax in query
Hello i have this query : It says me that : Incorrect syntax near the keyword “AND” Answer Try this
How can a blank MS Access database be created using VBA?
I’m a total noob trying to create a blank MS Access database using VBA in Excel. I want to name the new database “tblImport”. This is the code I´m using: I get the following error message: “Run Time Error 3001: Application Defined or Object Defined Error” What can I do? Answer The name of the locale constant in the CreateDatabase
MS Access – execute a saved query by name in VBA
How do I execute a saved query in MS Access 2007 in VBA? I do not want to copy and paste the SQL into VBA. I rather just execute the name of the query. This doesn’t work … VBA can’t find the query. Answer You can do it the following way: OR
clearing an entire column in access
is there a way to clear an entire column in a datasheet in access? i can just right click on it and delete it but that will affect the structure, i just need to clear all the records. how do i do this? perhaps the question i should be asking is how do i clear the entire contents of a
Passing combobox value into SQL query in MS Access
I have a combobox in a form, and I want the text of the combobox to be passed into a query. My query is: The form’s name is Enter Data and the combobox’s name is comboCup. Should i do this: or this? Answer You should use [Forms]![Enter Data]![comboCup]. As @Remou has said, the .Text property of an Access control is
Inner Join two tables when one column is a text and the other is number
I have a program in access that is using some linked ODBC tables. I had originally had a query that contained the following INNER JOIN: This worked just fine until the column Neptune_prem.premice_id got changed from a number to a text data type. So now I need a way to use an INNER JOIN on two columns when one is