Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Microsoft error

Hi!
I have this code:
Private Sub ComboBox3_Click()
Range("priskalk!$L$12").Value = ComboBox3.Value
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End Sub
And its working

But if i change the code into a IF then i get this Microsoft error
and excel crass

The code i use is:
Private Sub ComboBox3_Click()

Range("priskalk!$L$12").Value = ComboBox3.Value
If fradato.Text < "" And Tildato.Text < "" Then
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End If
End Sub
And the only diff between the first code and yhe next is:

If fradato.Text < "" And Tildato.Text < "" Then

I don't understand why ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Microsoft error

Let us know what the error is and in which line

Few suggestions
1. Declare your variables and use 'Option Explicit' statement
2. Getinto break mode F8 and anlayse in which line in breaks

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

Hi!
I have this code:
Private Sub ComboBox3_Click()
Range("priskalk!$L$12").Value = ComboBox3.Value
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End Sub
And its working

But if i change the code into a IF then i get this Microsoft error
and excel crass

The code i use is:
Private Sub ComboBox3_Click()

Range("priskalk!$L$12").Value = ComboBox3.Value
If fradato.Text < "" And Tildato.Text < "" Then
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End If
End Sub
And the only diff between the first code and yhe next is:

If fradato.Text < "" And Tildato.Text < "" Then

I don't understand why ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Microsoft error

Yes but thats the problem
I don't get what error, i just get this microsoft error, where i can say yes
to send the error.

But i solve it this way:
If fradato.Text < "" And Tildato.Text < "" Then
i change to
If formname.fradato.Text < "" And formname.Tildato.Text < "" Then

Alvin

"Jacob Skaria" skrev:

Let us know what the error is and in which line

Few suggestions
1. Declare your variables and use 'Option Explicit' statement
2. Getinto break mode F8 and anlayse in which line in breaks

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

Hi!
I have this code:
Private Sub ComboBox3_Click()
Range("priskalk!$L$12").Value = ComboBox3.Value
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End Sub
And its working

But if i change the code into a IF then i get this Microsoft error
and excel crass

The code i use is:
Private Sub ComboBox3_Click()

Range("priskalk!$L$12").Value = ComboBox3.Value
If fradato.Text < "" And Tildato.Text < "" Then
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End If
End Sub
And the only diff between the first code and yhe next is:

If fradato.Text < "" And Tildato.Text < "" Then

I don't understand why ?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Microsoft error

You can even try

Me.fradato.Text
--
If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

Yes but thats the problem
I don't get what error, i just get this microsoft error, where i can say yes
to send the error.

But i solve it this way:
If fradato.Text < "" And Tildato.Text < "" Then
i change to
If formname.fradato.Text < "" And formname.Tildato.Text < "" Then

Alvin

"Jacob Skaria" skrev:

Let us know what the error is and in which line

Few suggestions
1. Declare your variables and use 'Option Explicit' statement
2. Getinto break mode F8 and anlayse in which line in breaks

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

Hi!
I have this code:
Private Sub ComboBox3_Click()
Range("priskalk!$L$12").Value = ComboBox3.Value
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End Sub
And its working

But if i change the code into a IF then i get this Microsoft error
and excel crass

The code i use is:
Private Sub ComboBox3_Click()

Range("priskalk!$L$12").Value = ComboBox3.Value
If fradato.Text < "" And Tildato.Text < "" Then
pr_ekstrapris
pr_pakkepris
pr_hotelpris
If hotelpris < "" Then
txt_hotel.Text = hotelpris
txt_hotel.Enabled = False
End If
End If
End Sub
And the only diff between the first code and yhe next is:

If fradato.Text < "" And Tildato.Text < "" Then

I don't understand why ?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft windows Error MEL Excel Discussion (Misc queries) 0 March 21st 07 08:07 PM
Microsoft Windows Error MEL Excel Discussion (Misc queries) 1 March 19th 07 08:23 PM
Error using "IF" in Microsoft Excel Justin Excel Worksheet Functions 1 August 24th 05 11:31 AM
Error following Microsoft Article PJ Usher Excel Programming 12 October 4th 04 09:34 PM
Microsoft Excel Error ForSale[_14_] Excel Programming 14 August 24th 04 10:28 PM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"