?
Solved

Runtime error 3131(brewdog)

Posted on 2000-02-03
7
Medium Priority
?
352 Views
Last Modified: 2008-02-01
I am getting a runtime error in the code behind my combo box in the AfterUpdate Event Procedure.

This is my line of code:

Me.RecordSource = "select * from Join where GroupID = " & cboGroup

Join is my table name and GroupID is the number id of group/dept

I am however getting this error when I select a group/dept from the combo box cboGroup:

Runtime error 3131  Syntax error in from clause
0
Comment
Question by:kristinca
  • 3
  • 3
7 Comments
 
LVL 9

Accepted Solution

by:
BrianWren earned 400 total points
ID: 2487839
Me.RecordSource = "select * from [Join] where GroupID = " & cboGroup

Join is an SQL reserved word, so you must set it off with brackets.

Brian
0
 
LVL 10

Expert Comment

by:brewdog
ID: 2487861
eh! this question even has my name in it. :o) I don't think BrianWren has enough work to do . . .

His suggestion is the first thing I noticed, too, Kristin. You'll notice that in the DB I sent you, I named all of my tables starting with tbl. I do that for two reasons:

1. When looking at a list of objects, I immediately know what kind of object it is: tbl is table, qry is query, frm is form, cmd is command button, etc. When you start working on larger apps, this kind of naming convention will seem integral to you.

2. There are a lot of words Access doesn't like anyone else to use: Join, Name, Filter, Type, etc. By putting the "tbl" in front of my table, I can give them "reserved" words that describe what's in the table without Access choking on them. (Any reserved word will need to have brackets around it, as Brian says.)

brewdog

P.S. in future, you can e-mail me with followup questions like this. If they get tricky or if I'm very busy, I'll let you know and you can post them out here. This one probably wasn't worth 100 points, though. :o)
0
 

Author Comment

by:kristinca
ID: 2487863
Whoops! My mistake.  Thanks Lots.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 9

Expert Comment

by:BrianWren
ID: 2487880
First question I've gotten in 2 days!  Beware, it's a drought....
0
 
LVL 10

Expert Comment

by:brewdog
ID: 2489554
drought? Is that why I see your comments on just about every question I look at? You'd think that a rapid rise from not-even-on-the-top-15-list to almost-number-10 would be enough for you . . .
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2490286
The world is not enough . . .  (<Place maniacal laughter here>)
0
 
LVL 10

Expert Comment

by:brewdog
ID: 2490298
Thanks, Bond.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question