bounding an unbound

gregoryharvey

Registered User.
Local time
Yesterday, 19:54
Joined
Jul 14, 2006
Messages
24
newbie question
Is there anyway to bound an unbound text box to a print command button ?
 
Your question is a bit odd as you bind controls to tables and queries not buttons.

If you mean can you print whatevers in the textbox when you click a button, then yes you could although I don't know why you would want to print just 1 textbox.

Could you clarify what you're trying to do?

Carl
 
i wanted to use the text box as an indicator of how many labels to print for a selected record in a form.
do you know of a better way?
 
You don't bound the textbox to the command button. Rather within the VBA code, you have the command button retrieve the value from textbox. Something like:

Code:
MyValue = Me.MyTextBox
 
impretty sure we can help you, just try to be a little more specific with your situation and what you want out of this.

my best guess is you have a button that prints a record, through a report, maybe, and you want a text box that is supposed to be filled with a number, that would be the number of times to print out the record?
 
im sorry
its a form and i wanted the user to say how many labels to print because it changes often.
i really dont know how to explain it so im sending an attachment to you.
once open its the label 2006 button on the switchboard.thanks
 

Attachments

Last edited:
well.. all i can tell you is you should look into the reports in access, i think

have the report print out duplicates, or create a temp table that you fill in and can have dups there, and then later print out everything in that table through a report
 
i have tried the reports all night ad it really only works on the numbers of pages of an entire table and i cant find a way for a user to edit the current record in a report.
 

Attachments

if you look at the file in the labels 2006 form. i want the user to put how many labels they want in that text box and when they click the print command button, want it to print the amount in the box on a single sheet. i tried to use a macro yesterday but it prints for example if a say 4 copies it prints for labels on for single pages.
is there anyway around this?
 
the way i would do it is this, have a report based on a duplicate structure table called tblReport or something similar, when they click the print button, have it copy each record into the new table, the specified number of times, and then have the report print everything in the new table

if you need any help with the code behind this, i'd be glad to go through it with you or give you an example
 
thanks, i really do need your help. i guess i just have to catch you online.
 
sorry i have been busy lately, but all you need to do is look up the INSERT INTO sql command. If the tables have a completely duplicate structure (except of course that the report table has no auto numbers) then you can use that to say, for example:

Code:
DoCmd.RunSQL "INSERT INTO tblReport SELECT * FROM tblOriginal WHERE Field='Something';"

thats just a quick example so you can probably figure it out beyond that.. here is a page that explains the insert command...
http://www.w3schools.com/sql/sql_insert.asp
 
Last edited:
as always, let us know if it works so we can reference this post later if the same thing comes along :)
 
The following code gives me an error:

Private Sub PRINT_Click()
On Error GoTo Err_PRINT_Click

DoCmd.RunSQL "INSERT INTO tblReport SELECT * FROM labels2006 WHERE Field='Something';"
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_PRINT_Click:
Exit Sub

Err_PRINT_Click:
MsgBox Err.Description
Resume Exit_PRINT_Click

End Sub

cannot find output tblreport. am i doing this correct?
 
sorry if this is a little late, but whats the problem? are you sure the fields and everything are what they need to be?

check the WHERE part of the sql string, and make sure that there are NO differences between the table designs.
 

Users who are viewing this thread

Back
Top Bottom