grivers
Posts: 28
|
Posted: 12/10/2008, 3:32 AM |
|
I have a date due field that needs to be populated when a record is created or updated depening on the priority of the record. Priority text chioces are low, medium and high.
I would like the due date to be automatically entered depending on the chioce made for the priority. e.g.
Priority = low, due date is eqaul to today + 60 days
I thought I would be able to do this using code similar to below but have not got it working yet. It keeps saying expected end.
If (enquiry.priority.Text = "Low") then enquiry.TextBox1.Text = Date()+60
Else If (enquiry.priority.Text = "Medium") then enquiry.TextBox1.Text = Date()+120
|
|
|
JimmyCrackedCorn
Posts: 583
|
Posted: 12/10/2008, 6:08 AM |
|
try this,
If (enquiry.priority.Text = "Low") then enquiry.TextBox1.Text = DateAdd("d",60,Date())
Else If (enquiry.priority.Text = "Medium") then enquiry.TextBox1.Text = DateAdd("d",120,Date())
_________________
Walter Kempees...you are dearly missed. |
|
|
JimmyCrackedCorn
Posts: 583
|
Posted: 12/11/2008, 10:32 AM |
|
did this work?
_________________
Walter Kempees...you are dearly missed. |
|
|
grivers
Posts: 28
|
Posted: 12/12/2008, 12:45 AM |
|
Yes, this worked thank you very much. Couldn't log in the other day to say thanks.
|
|
|
JimmyCrackedCorn
Posts: 583
|
Posted: 12/12/2008, 8:04 AM |
|
excellent! here is a great vbscript resource I use all the time,
http://www.w3schools.com/Vbscript/default.asp
I don't even try and remember syntax, functions or anything any more; I just jump to that site and look it up!!
oh and be sure to add [RESOLVED] or [SOLVED] to your forum title.
_________________
Walter Kempees...you are dearly missed. |
|
|