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

Continuous Forms Problem

Status
Not open for further replies.

Sensibilium

Programmer
Apr 6, 2000
310
GB
Okay, it's a little difficult to hexplain, so I'll start with an example of the form:

[tt]
Item Code Description Qty
LG01 Dinner Plate 1230
LG02 Dessert Plate 1230
LG03 Tea Plate 1230
LG04 Soup/Cereal 1230
[/tt]

Okay, the above is the structure of my order form, however, I want to be able to make the 'ItemCode' control disabled, if 'QtyAllocated' > 0 (not shown on form, but it does exist!), but only on one line.

IE: Say 'LG01' has 1230 allocated, then the control containing 'LG01' needs to be disabled.
However, if 'LG02', 'LG03', & 'LG04' has 0 allocated, then the control containing those values need to be enabled.

Any idea's?

Thanks in advance.


ahdkaw
ahdkaw@ots.zzn.com
'If anythign can go wrong, it will'
 
What control are you talking about?
Do you want the Text box so you can't type anything in it?

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
The control I'm talking about is the 'Item Code' combo box control, where I want to be able to allow the user to change the product on order if that particular product hasn't been delivered or allocated.

As some of the product lines on the order may have already been delivered or allocated I don't want the user being able to alter them in any way (except maybe the order qty's).

~Maybe~ I should forget about trying to disable the individual controls, and find some other way to stop the user changing products that have been delivered/allocated? ~maybe~ I should use a warning Msgbox on the after update event? But then how do I make the user aware that a certain product line has been allocated/despatched (without having to add another field to the underlying table)?

Don't forget this is on a continuous form so the control Me.cboItemCode refers to all lines in the form...


ahdkaw
ahdkaw@ots.zzn.com
'If anythign can go wrong, it will'
 
Okay. Due to the lack of responses to this issues, I've had to think long and hard, and I think I have come up with the only workable solution:

On the After_Update event, if the Item Line Product has been allocated or delivered, a message box pops up stating that the product cannot be changed due to allocations/delivery, and then resets the product code to OldValue.

A simple solution, and not quite what I wanted but it shall have to do.


ahdkaw
ahdkaw@ots.zzn.com
'If anythign can go wrong, it will'
 
Why not just set the locked or enabled property to false if 'QtyAllocated' > 0, use the form's OnCurrent event to check this? The form will aways refer to the current record, even with continuous forms. Rob Marriott
robert_a_marriott@yahoo.com

Hire me! Full-time, contract, whatever...shhh don't let my current employer know I said that.
 
What I have done now, is that when someone enters the ItemCode control, I test for QtyAllocated > 0 (during On_Current Event), and if true I just SetFocus to the Quantity control.

Does the trick...


ahdkaw
ahdkaw@ots.zzn.com
'If anythign can go wrong, it will'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top