By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

need help with a vb statement in access

P: 7
i need help with vb in access. i have table call main_tbl and another table called details_tbl.

main_tbl has the following fields
issueID, text, PK
PN, text
description, text
openby, text
opendate, date

details_tbl has the following fields. the details_tbl is use by other forms
id, text
PN, text
user, text
udate, date

the problem i am encountering is that when i do following script
db.Execute "INSERT INTO details_tbl SELECT main_tbl .IssueID,main_tbl.PN,main_tbl.OpenBy,main_tbl.Date Opened from main_tbl "
i get an error of "the insert into statement contain the following unknown field: openby....". i have feeling i know why it popup but how can i make this work properly without renaming openby field because it is use by other forms.
Aug 15 '08 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 112
Based on what you are posting you are trying to insert the field OpenBy from the Main_tbl into the Details_tbl, however there is no corresponding OpenBy field in the Details_tbl. Don't include it in your select statement, only include the fields that will actually be appended in your select statement.
Aug 15 '08 #2

P: 7
thought so, thanks anyway
Aug 15 '08 #3

Expert 100+
P: 112
I may be inferring too much by your response, but this won't break anything in your other forms because you aren't changing the underlying table structure, it only affects the one query you are using so this shouldn't have an affect on anything else. Does that help?
Aug 15 '08 #4

Post your reply

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