Skip to content

Tag: vba

Unpivot Access Data Table

Good afternoon, I would like to unpivot an Access Table. I have almost one hundred of columns in Access and one column with the ID and I would like to unpivot, considering all the columns except de ID into one column called “type” (for example). How could I get it from Access? It doesnt matter if is by a SQL

Using Variables in a MSAccess Function with SQL

I’m struggling with entering a custom made ID number on all my tables to link all records together, trying out normalization. I have an EmployeeDetails table and a LoginDetails table. Its my understanding that I need a field called EmployeeID on both and I can use the SQL Select code I have to pull the data like on other forms.

Using the Like operator with two fields

How do I use the Like operator to join two unidentical tables as below? My main problem is on how to compare the PO filed on tbl2 to the EditNo on tbl1 field. Please see sample tables and expected results below: tbl1: tbl2: Expected: Query: SELECT * FROM tbl2 INNER JOIN tbl1 ON tbl2.PONo LIKE EditNo.PO; Answer You need wildcards:

Reading Excel file with SQL returns null due to empty column

I am attempting to read in an Excel File from a third party but it falls over and returns null due to empty column. The file has 50 columns, a blank column and a further 48 columns. I only want the first 50 columns. If I delete or populate the empty column in Excel it works but I need to

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