Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
caljohn527
Starting Member
4 Posts |
Posted - 2009-02-04 : 21:03:55
|
| Hello to you all.This is what I try to do and is not working ???MS SQL Server 2003 and Access 2002 Private Sub emppoint1_BeforeUpdate(Cancel As Integer)If me.txt_empappearance = poor Then me.txt_emppoint1 = 5If me.txt_empappearance = Good Then me.txt_emppoint1 = 10If me.txt_empappearance = Fair Then me.txt_emppoint1 = 15If me.txt_empappearance = Excellent Then me.txt_emppoint1 = 20 not working ??? ( The return is #Nmae? ) End SubPrivate Sub emppoint1_BeforeUpdate(Cancel As Integer)If txt_empappearance = poor Then txt_emppoint1 = 5If txt_empappearance = Good Then txt_emppoint1 = 10If txt_empappearance = Fair Then txt_emppoint1 = 15If txt_empappearance = Excellent Then txt_emppoint1 = 20 not working ??? ( The return is #Nmae? ) End Subempappearance is a combo box = ( Poor – Fair – Good – Excellent )emppoint1 is the receiving end ( 5 – 10 – 15 – 20 )emppoint1 / right click / go to properties / name = emppoint1 / Control Source = emppoint1 / Format = blank / Decimal places = auto /Input Mask = blank / Default Value = blank .In The Tables we have empappearance / nvarchar / 10In The Tables we have emppoint1 / smallint / 2What am I doing so wrong ?????Johnny C And Thank you all for your help… |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-04 : 22:28:18
|
| This is forum for SQL Server. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 05:04:14
|
I think you should enclose your combobox checks with double quote character, unless values are enumerations.If txt_empappearance = "poor" Then txt_emppoint1 = 5 E 12°55'05.63"N 56°04'39.26" |
 |
|
|
caljohn527
Starting Member
4 Posts |
Posted - 2009-02-05 : 06:11:15
|
Hi PESO and thank you for the information.But it is not working.SQL Server 2003 and Access 2002Private Sub emppoint1_BeforeUpdate(Cancel As Integer)If txt_empappearance = "poor" Then txt_emppoint1 = 5If txt_empappearance = "Good" Then txt_emppoint1 = 10If txt_empappearance = "Fair" Then txt_emppoint1 = 15If txt_empappearance = "Excellent" Then txt_emppoint1 = 20 not working ??? ( The return is #Nmae? ) Same resultJohnn C |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 06:15:17
|
You have also named a combobox with txt?TryIf txt_empappearance.Value = "poor" Then txt_emppoint1.Text = 5etc etc E 12°55'05.63"N 56°04'39.26" |
 |
|
|
caljohn527
Starting Member
4 Posts |
Posted - 2009-02-05 : 06:40:44
|
Hi Peso and thank you for your time and effort.I tried this But not work .Private Sub emppoint1_BeforeUpdate(Cancel As Integer)If txt_empappearance.Value = "poor" Then txt_emppoint1.Text = 5If txt_empappearance.Value = "Good" Then txt_emppoint1.Text = 10If txt_empappearance.Value = "Fair" Then txt_emppoint1.Text = 15If txt_empappearance.Value = "Excellent" Then txt_emppoint1.Text = 20End Subnot working ??? ( The return is #Nmae? ) Same resultJohnn C |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 07:36:22
|
What line is producing the error? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
caljohn527
Starting Member
4 Posts |
Posted - 2009-02-05 : 19:42:25
|
Hi Peso Read This If You have The Time . Dim text As StringIf IsNull(Me.empappearance.Value) = False Then text = Me.empappearance.Value Select Case text Case "Good" Me.emppoint.Value = 1 Case "Poor" Me.emppoint.Value = 2 Case "Excellent" Me.emppoint.Value = 3 Case "Fair" Me.emppoint.Value = 4 Case Else Me.emppoint.Value = "Nothing" End SelectEnd IfEnd SubWhen I try to compile this I get an error,and it said Microsoft Visual Basic Compile error Invalid Outside ProcedureOn the first line at the Me. it stops Compile.If IsNull(Me.???Johnny C |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-06 : 00:21:51
|
Is ISNULL a VB function?If Me.empappearance.Value) > "" Thentext = Me.empappearance.Value E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|