Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Another code question

I have the following code: Thats giving me an invalid qualifying error? in
the line: myDirectory.......

Private Sub OK_Click()
Dim myDirectory As String
Dim myFilename As String
Dim myLocationOut As String


If IsEmpty(TAB_DIRECTORY.Value) Then
MsgBox "please provide directory"
Else
myDirectory.Value = Me.TAB_DIRECTORY.Value
End If

If IsEmpty(File_Name.Value) Then
MsgBox "please provide filename"
Else
myFilename.Value = Me.File_Name.Value
End If


If IsEmpty(Location_Out.Value) Then
MsgBox "Provide info "
Else
myLocationOut.Value = Me.Location_Out.Value
End If

Next
UserForm3.Hide
End Sub



The command button "OK" is on userform3
The "TAB_DIRECTORY" is the name of text box1 within userform3
The "File_Name" is the name of textbox2 within userform 3
The "Location_Out" is the name of textbox 3 within userform 3

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Another code question

myDirectory is a string and not an object with a value property so you don't
want to use the .Value qualifier.

myDirectory = Me.TAB_DIRECTORY.Value
--
HTH...

Jim Thomlinson


"M&M" wrote:

I have the following code: Thats giving me an invalid qualifying error? in
the line: myDirectory.......

Private Sub OK_Click()
Dim myDirectory As String
Dim myFilename As String
Dim myLocationOut As String


If IsEmpty(TAB_DIRECTORY.Value) Then
MsgBox "please provide directory"
Else
myDirectory.Value = Me.TAB_DIRECTORY.Value
End If

If IsEmpty(File_Name.Value) Then
MsgBox "please provide filename"
Else
myFilename.Value = Me.File_Name.Value
End If


If IsEmpty(Location_Out.Value) Then
MsgBox "Provide info "
Else
myLocationOut.Value = Me.Location_Out.Value
End If

Next
UserForm3.Hide
End Sub



The command button "OK" is on userform3
The "TAB_DIRECTORY" is the name of text box1 within userform3
The "File_Name" is the name of textbox2 within userform 3
The "Location_Out" is the name of textbox 3 within userform 3

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Another code question


Thank you so much Jim, one last question about the same macro. Why Im I
getting an error in the "Next UserForm hide"




"Jim Thomlinson" wrote:

myDirectory is a string and not an object with a value property so you don't
want to use the .Value qualifier.

myDirectory = Me.TAB_DIRECTORY.Value
--
HTH...

Jim Thomlinson


"M&M" wrote:

I have the following code: Thats giving me an invalid qualifying error? in
the line: myDirectory.......

Private Sub OK_Click()
Dim myDirectory As String
Dim myFilename As String
Dim myLocationOut As String


If IsEmpty(TAB_DIRECTORY.Value) Then
MsgBox "please provide directory"
Else
myDirectory.Value = Me.TAB_DIRECTORY.Value
End If

If IsEmpty(File_Name.Value) Then
MsgBox "please provide filename"
Else
myFilename.Value = Me.File_Name.Value
End If


If IsEmpty(Location_Out.Value) Then
MsgBox "Provide info "
Else
myLocationOut.Value = Me.Location_Out.Value
End If

Next
UserForm3.Hide
End Sub



The command button "OK" is on userform3
The "TAB_DIRECTORY" is the name of text box1 within userform3
The "File_Name" is the name of textbox2 within userform 3
The "Location_Out" is the name of textbox 3 within userform 3

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Another code question

Oops Ok I figured it out. I guess I dont need that Next statement
Thank You

"M&M" wrote:


Thank you so much Jim, one last question about the same macro. Why Im I
getting an error in the "Next UserForm hide"




"Jim Thomlinson" wrote:

myDirectory is a string and not an object with a value property so you don't
want to use the .Value qualifier.

myDirectory = Me.TAB_DIRECTORY.Value
--
HTH...

Jim Thomlinson


"M&M" wrote:

I have the following code: Thats giving me an invalid qualifying error? in
the line: myDirectory.......

Private Sub OK_Click()
Dim myDirectory As String
Dim myFilename As String
Dim myLocationOut As String


If IsEmpty(TAB_DIRECTORY.Value) Then
MsgBox "please provide directory"
Else
myDirectory.Value = Me.TAB_DIRECTORY.Value
End If

If IsEmpty(File_Name.Value) Then
MsgBox "please provide filename"
Else
myFilename.Value = Me.File_Name.Value
End If


If IsEmpty(Location_Out.Value) Then
MsgBox "Provide info "
Else
myLocationOut.Value = Me.Location_Out.Value
End If

Next
UserForm3.Hide
End Sub



The command button "OK" is on userform3
The "TAB_DIRECTORY" is the name of text box1 within userform3
The "File_Name" is the name of textbox2 within userform 3
The "Location_Out" is the name of textbox 3 within userform 3

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
Repost of VBA Code/Lookup question Steve_n_KC Excel Worksheet Functions 5 June 23rd 07 01:34 AM
VB Code Question Stan Excel Discussion (Misc queries) 2 May 2nd 07 10:13 PM
VB Code Question Stan Excel Discussion (Misc queries) 6 April 30th 07 11:27 PM
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM
Easy VB code question Anthony Excel Discussion (Misc queries) 2 July 8th 05 08:45 PM


All times are GMT +1. The time now is 07:15 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"