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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to "unbound" a bound textbox?

Status
Not open for further replies.

BigBas

Technical User
Jun 9, 2007
2
US
Is it possible to "unbound" a bound textbox, or to otherwise modify data in a bound textbox without changing the control data?
I'm a new user to Access who has hit a roadblock that has slowed me down significantly. I have a numeric value in a text box that is linked to a control that is linked directly to a table. For reference sake, the "Control" in the properties menu of this text box is =[Amount] .

Sometimes, I need to modify this amount in the text box, but Access will not allow it, saying that the text box is bound. If I change the Control in my properties menu to Amount, then it allows me to change the amount, but it also changes the original, which is linked directly to the table.

That said, is there anyway to UNBOUND the textbox AFTER it has been changed within a record? So, for example, if I selected product 1, and it gave me an amount of $100.00, the textbox would state $100.00. Now, lets say I wanted to give this guy a deal, I would like to change the amount to $95.00 for this particular sale only (I don't want it to change the Amount in the products table).
[Note: I do realize the possibility that a separate "Amount Discount" text box can be set up, as well as a "Total Amount" via a calculated field, but that is a LAST resort, and would prefer not to do it.

Thanks for your help.
 
How are ya BigBas . . .

You need an additional textbox to hold the discount amount no matter how you look at it. Particularly if the discount amount needs to be saved . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
TheAce.

Thanks for your time/reply. Just to clarify, I don't need the amount of the discount to be saved; I just need the final amount.

To work off of the previous example, I have a product ID. Once I select the product ID, a price is automatically populated into the Amount textbox, ($100.00 for example). I want to be able to change this $100.00 to $95.00 WITHOUT changing the price of that specific product in the products table.
So, for example if I were to run a query for products, product 1 would show $100.00. However, in my Sales table, if I looked at one specific sale, product 1 may show $95.00.

Does this change things, or will I still have to use the roundabout method?
 
Roger That BigBas . . .

Understand . . . I fully grasp the delima of your post origination. Since your latest post it appears, how your geting the [blue]discount price[/blue] to appear in the [blue]Sales Table[/blue] is the real issue! . . . Can you expand on this?

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
If I understand this correctly, the value you want to have in the Amount text box will eventually be preserved in a field in your Sales table, is that right? You want it initially to display a value from your Products table, but still allow the value to be changed for discounts, etc?

Let's say the Product table has the value of $100 in ProductPrice, and you will store the eventual amount (say $95) in the Sales table in a field named SaleAmount. Let's also say that you have corresponding text boxes with the same names as the fields they're bound to.

What you want to do is have a line of code (probably in the form's Current event handler) that takes the value from ProductPrice and assigns it to SaleAmount:

Code:
 Me![SaleAmount] = Me![ProductPrice]

This will initially put $100 in the ProductPrice field, but you can then change it to whatever you want, and have that value stored in the Sales table.
 
Sorry ... I should have said:

This will initially put $100 in the SaleAmount field (from ProductPrice) but then ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top