Tag archive for ‘access’

Access Form Question: Pass value to query and update subform

Question:
Looking for a way to lookup a company name and display all the contacts associated with that company.
We have one table that has all the contacts in it.  Each contact record also has a company name in it.
I would like to have a form with a subform. The subform would display the records where the [...]

Import Crosstab Query From Access into Excel WITH Column Headings

Question:
I am inporting an Access Crosstab query into excel, and then doing some vlookups on the imported data.  Everything works great unless an additional item is added to the crosstab query…then many of my vlookups are incorrect because the items I want are not in the same places anymore.  I would like to import the [...]

Query with Recordset-Dependent Field Values

Question:
I have two Access Tables.
Table 1: contains an identifier and a value, call it B(0,k), where k in [1,n], n = # of recordsets
Table 2: contains a set of fields:
1. identifier: i(k), where k runs over n.
2. dates: D(i(k), t), where i is fixed identifier, t ranges over a time period [0, T]
3. value1: v1(i(k), [...]

How do I get the Process ID of an Access automation object of Word and terminate just that instance of WinWord from Access?

Question:
Dim WordObj as “Word.Application”
Set WordObj = CreateObject(“Word.Application”)
get the instance/handle of WordObj
do some processing
If necessary terminate the instance of WinWord associated with the WordObj and not terminate all instances of WinWord, via API
Solution:
here you go!
see Topic: Examples of Using late binding to connect to other applications
http://excelguru.ca/node/10
This code will bind to an existing instance of Word, or [...]

Decimal separator issues – VB.Net and MS Access

Question:
To cut it short, I need to include numbers with decimal digits in an UPDATE/INSERT query, and although I am able to have my SQL code to use either dots or commas according to whatever the culture setting is for the current computer, I am experiencing that Access routinely ignores this, and only accept dot [...]

Chronological Host / Attachments sorting in Access

Question:
I have an access database table that I essentially want to Sort in Chronological Order whilst maintaining Host/Attachment relationships (where host attachment relationships are denoted by Column ‘SHA’ where values are: Single (Ignore), Host and subsequent Attachments, until new Host or Single), so its not a simple matter of filtering in Ascending Order.
Basically, I can [...]

Return listbox row index based on search criteria

Question:
Hi All,
I can’t seem to find a simple solution to this one.
I have a list box with 5 columns that displays a small amount of customer information.
Behind the form contiaining the listbox I have some code that returns a customer number (from other things the user can do not related to the listbox)
What I want [...]

How do I get a print preview of only the records with the date the user enters?

Question:
The follow code is giving me a type mismatch in Criteria expression Error ‘3464′
Maybe something to do with the VisitDate data type.  I’ve tried 03/11/10 and 03/11/2010 since my debug says the current value of strCriteria1 is 03/11/2010 when I’ve entered either way.  My table data type is set up with format mm/dd/yy
Private Sub cmdPrintDate_Click()
‘Open [...]

Access and SQL Server – Copy data to Access

Question:
What is the best method to copy data into an Access Table?
We have SQL Server with the table and i know the SQL query needed
It is to be an occasional import,
optionally Import New lines only, Refresh all data.
Solution:
Another example:
UPDATE tblAddress
INNER JOIN tblZipCodes ON [tblAddress].[ZipCode] = [tblZipCodes].[ZipCode]
SET [tblAddress].[City]  = [tblZipCodes].[City],
[tblAddress].[State] = [tblZipCodes].[State]
WHERE ([Country] = ‘US’)

Matching the cells in two columns in MS Excel?

Question:
To begin, I run a business and this concerns my inventory…
I have two columns in MS Excel.
“Column A” has 73,764 cells
“Column B” has 73,864 cells
It’s a 100 cell difference between the two. Simple, right? Well, “Column B” not only has 100 more cells been added to the column–but 100 other cells have been DELETED in [...]