473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Query Error in VBA Access 2000

Forgive me as I am new to this forum and to Access, but here is my code. I can't get the Employee name to come up, only the Employee ID number.

Expand|Select|Wrap|Line Numbers
  1. Private Sub List2_AfterUpdate()
  2.     With Me.List4
  3.         .RowSource = "SELECT InventoryID, Platform, EmployeeID " & _
  4.         "FROM Inventory " & _
  5.  
  6. (This is where I put my inner join to join the tables, Inventory and Employees).
  7.  
  8.        "WHERE Company = " & Chr(34) & Me.List0 & Chr(34) & _
  9.         "AND Application = " & Chr(34) & Me.List2 & Chr(34) & _
  10.         "ORDER BY InventoryID, Platform, EmployeeID"
  11.  
  12. (Then I placed Employees.Employee in place of EmployeeID and changed that in the SELECT portion of the above rowsource).
  13.  
  14.         .ColumnCount = 3
  15.         .ColumnWidths = "0;1.5 IN;1.5 IN "
  16.         .ColumnHeads = True
  17.         .Requery
  18.          End With
  19.     With Me.List2
  20.      End With
  21.         Me.Label7.Caption = Me.List4.ListCount & _
  22.         " Platforms and Employees in " & Me.List2 & ", " & _
  23.         Me.List0
  24. End Sub
I get a syntax error, but can't figure out why.
Any suggestions?
dewylie
Jan 11 '07 #1
4 1628
NeoPa
32,556 Expert Mod 16PB
I suggest you post the code you're actually using with the error message and an indication of the line it highlights when reporting the error.
Jan 12 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Try this ..

Expand|Select|Wrap|Line Numbers
  1. Private Sub List2_AfterUpdate()
  2.     With Me.List4
  3.         .RowSource = "SELECT InventoryID, Platform, Employee " & _
  4.         "FROM Inventory INNER JOIN Employees " & _
  5. "ON Inventory.EmployeeID=Employees.EmployeeID " & _
  6. "WHERE Company = " & Chr(34) & Me.List0 & Chr(34) & _
  7.         " AND Application = " & Chr(34) & Me.List2 & Chr(34) & _
  8.         " ORDER BY InventoryID, Platform, Employee;"
  9.  
  10. .ColumnCount = 3
  11.         .ColumnWidths = "0;1.5 IN;1.5 IN "
  12.         .ColumnHeads = True
  13.         .Requery
  14.          End With
  15.     With Me.List2
  16.      End With
  17.         Me.Label7.Caption = Me.List4.ListCount & _
  18.         " Platforms and Employees in " & Me.List2 & ", " & _
  19.         Me.List0
  20. End Sub
Jan 12 '07 #3
Thank you, thank you, thank you, mmccarthy.
I just tried it and it works PERFECTLY! You are a lifesaver!!!
Jan 12 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Thank you, thank you, thank you, mmccarthy.
I just tried it and it works PERFECTLY! You are a lifesaver!!!
Not a problem. I'm glad it worked out for you.

Mary
Jan 12 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Starbuck | last post by:
OK, first let me say that I am no DB person. But I have a user here who keeps getting this error whenever she does, whatever it is she does, with databases... A google search takes me to...
5
by: Ken Lindner | last post by:
We have a report based on a query that is called from a form. Nothing too special here. The query has 3 coulmns that are populated directly from values entered into entry fields on the form...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
1
by: j.mandala | last post by:
I created a simple link between two tables in a query. TableA has Social Security numbers stored as Long Integer Data. (I imported this table). The Join is between these two fields Table ...
12
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
3
by: Lynn A. | last post by:
Access/Word 2000 I am trying to merge a word document with an access query that has a parameter attached to it. Could someone please suggest how to stop the parameter from appearing when the...
2
by: Bibi | last post by:
Hi, i have a SqlWindows Program which made a connection to a MS Access Database about ODBC. I can get all datas with a select about one table. But when i made a select with more than one table,...
3
by: ILCSP | last post by:
Hello, I'm fairly new to the concept of running action pass through queries (insert, update, etc.) from Access 2000. I have a SQL Server 2000 database and I'm using a Access 2K database as my...
2
by: ILCSP | last post by:
Hello, I'm in the process of changing our 'normal' Access 2000 update queries to Update Pass Through Queries. We have a SQL server 2000 database and we're using an Access 2000 database as our...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.