Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add notes to our textbox

Status
Not open for further replies.

cthai

Technical User
Apr 19, 2011
53
US
Hello -

I'm tying to do a mass update adding notes to our Access 2007 database, but I'm running into an issue -

I am matching an empyee ID worksheets up with our master table in access 2007. i would like to add a note that say:


Date: Batch update: subj is part of upgrade project. subj has close "type of duties" (this is a field in the form that i want it to auto populate with matching ID) of "COMPLETION_DATE " (again part of the form that i would like to auto populate)

but each time i try to do this, it gives me an error message
" The specified field '[TYPE_OF_DUT]' could refer to more than one table listed in the FROM clause of your SQL statement."

Code:
[ConfirmationComment] & Chr(13) & Chr(10) & "8/05/2011: Batch update- Subj is part of UPGRADE project.  Subj has close " & [TYPE_OF_DUT] & " of " & [COMPLETION_DATE] & ". & Chr(13) & Chr(10)
 

Does this not work?
Code:
[ConfirmationComment] & Chr(13) & Chr(10) & "8/05/2011: Batch update- Subj is part of UPGRADE project.  Subj has close " & [b][red][YourTableName].[/red][/b][TYPE_OF_DUT] & " of " & [COMPLETION_DATE] & ". & Chr(13) & Chr(10)

Randy
 
Hi Randy -

that didnt work... it actually populate the table name in the raw format...

this is out it populated:
Code:
8/05/2011: Batch update- Subj is part of UPGRADE project.  Subj has close [dbo_Master DATABASE].[TYPE_OF_DUT] of [txtCOMPLETION_DATE]

is there away i can have it pull the data from the master database.type of dut and completiondate to be fill in?
 

If [TYPE_OF_DUT] and [COMPLETION_DATE] are Fields on your Form
"type of duties" (this is a field in the form that i want it to auto populate with matching ID) of "COMPLETION_DATE " (again part of the form that i would like to auto populate)
Do you want to put the data into those fields from your database, or you already have values in those fields and you want to use them in your string?

What does it show in Immediate Window if you do this:
[tt]
Debug.Print "Type of Duty is: " & [TYPE_OF_DUT]
Debug.Print "Compl Date is: " & [COMPLETION_DATE]
[/tt]

Have fun.

---- Andy
 
Hi Andy -

I already have values in those fields and would like to use them in my string.

I try to run the debug.print in access 2007 and it's giving me an error message..
 
Hi Andy -

i'm getting an 'Invalid SQL statement; expected ' delete,' insert', procedure, select or update.

 

That's a weird error message ('Invalid SQL statement; expected ' delete,' insert', procedure, select or update) on the Debug line:
I try to run the debug.print in access 2007 and it's giving me an error message

And that's what you get on those lines:[tt]
Debug.Print "Type of Duty is: " & Me.[TYPE_OF_DUT]
Debug.Print "Compl Date is: " & Me.[COMPLETION_DATE]
[/tt]
???

Have fun.

---- Andy
 
yes that was the error message that i get when i try to run the debug print
 
OK i totally apologize for the miscommunication... i am running this in SQL access 2007 not the vb.
 

So where do you have this code:
Code:
[ConfirmationComment] & Chr(13) & Chr(10) & "8/05/2011: Batch update- Subj is part of UPGRADE project.  Subj has close " & [TYPE_OF_DUT] & " of " & [COMPLETION_DATE] & ". & Chr(13) & Chr(10)
If it is NOT in VBA?

Have fun.

---- Andy
 
Hi Andy -

I have it in my UPDATE query in Access 2007-
 

But your [TYPE_OF_DUT] and [COMPLETION_DATE] are Fields on your UserForm, right? If so, what's the name of your UserForm?

Because this may work:
Code:
[ConfirmationComment] & Chr(13) & Chr(10) & "8/05/2011: Batch update- Subj is part of UPGRADE project.  Subj has close " & 
[blue]UserFormName.[/blue][TYPE_OF_DUT] & " of " & [blue]UserFormName.[/blue][COMPLETION_DATE] & "." & Chr(13) & Chr(10)

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top