PC Review


Reply
Thread Tools Rate Thread

What is the Correct Data Type?

 
 
ryguy7272
Guest
Posts: n/a
 
      12th Jun 2008
The code below keeps failing.
Dim i_pwd As Variant

i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
If i_pwd = "" Then
Exit Sub
End If

Select Case LCase(i_pwd)
Case Is = "ryan72"
Worksheets("Ryan - Summary").Visible = True
Sheets("Ryan - Summary ").Select

A message pops up saying, 'Incorrect Password...'
I know the password is correct, I am not sure about the Data Type though.
Can someone please give me some guidance?

Thanks so much,
Ryan---


--
RyGuy
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      12th Jun 2008
This Data Type appears to be working:
Dim i_pwd As String

I could swear that In tried it before and it didn't work. I guess I posted
my question too quickly; a little trial and error would have revealed a
solution in the same amount of time.


Thanks,
Ryan---

--
RyGuy


"ryguy7272" wrote:

> The code below keeps failing.
> Dim i_pwd As Variant
>
> i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
> If i_pwd = "" Then
> Exit Sub
> End If
>
> Select Case LCase(i_pwd)
> Case Is = "ryan72"
> Worksheets("Ryan - Summary").Visible = True
> Sheets("Ryan - Summary ").Select
>
> A message pops up saying, 'Incorrect Password...'
> I know the password is correct, I am not sure about the Data Type though.
> Can someone please give me some guidance?
>
> Thanks so much,
> Ryan---
>
>
> --
> RyGuy

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      12th Jun 2008
I don't think it was the declaration--although I would have use "as String",
too.

I don't think you typed in the correct password in the inputbox.

Or something else happened in the part of your code that you didn't share.

ryguy7272 wrote:
>
> This Data Type appears to be working:
> Dim i_pwd As String
>
> I could swear that In tried it before and it didn't work. I guess I posted
> my question too quickly; a little trial and error would have revealed a
> solution in the same amount of time.
>
> Thanks,
> Ryan---
>
> --
> RyGuy
>
> "ryguy7272" wrote:
>
> > The code below keeps failing.
> > Dim i_pwd As Variant
> >
> > i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
> > If i_pwd = "" Then
> > Exit Sub
> > End If
> >
> > Select Case LCase(i_pwd)
> > Case Is = "ryan72"
> > Worksheets("Ryan - Summary").Visible = True
> > Sheets("Ryan - Summary ").Select
> >
> > A message pops up saying, 'Incorrect Password...'
> > I know the password is correct, I am not sure about the Data Type though.
> > Can someone please give me some guidance?
> >
> > Thanks so much,
> > Ryan---
> >
> >
> > --
> > RyGuy


--

Dave Peterson
 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      12th Jun 2008
I'm fairly certain that I typed the correct password. I thought it had
something to do with the number, the 72-part. I tried it with another
password, such as 'showryan', and that worked, but the 'ryan72' didn't
work...at least at first. I thought the 72-part was not considered text so
it wouldn't work as a String. I don't know what the problem was, but it
appears to be resolved now. Thanks, for getting back to me Dave.

Regards,
Ryan---

--
RyGuy


"Dave Peterson" wrote:

> I don't think it was the declaration--although I would have use "as String",
> too.
>
> I don't think you typed in the correct password in the inputbox.
>
> Or something else happened in the part of your code that you didn't share.
>
> ryguy7272 wrote:
> >
> > This Data Type appears to be working:
> > Dim i_pwd As String
> >
> > I could swear that In tried it before and it didn't work. I guess I posted
> > my question too quickly; a little trial and error would have revealed a
> > solution in the same amount of time.
> >
> > Thanks,
> > Ryan---
> >
> > --
> > RyGuy
> >
> > "ryguy7272" wrote:
> >
> > > The code below keeps failing.
> > > Dim i_pwd As Variant
> > >
> > > i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
> > > If i_pwd = "" Then
> > > Exit Sub
> > > End If
> > >
> > > Select Case LCase(i_pwd)
> > > Case Is = "ryan72"
> > > Worksheets("Ryan - Summary").Visible = True
> > > Sheets("Ryan - Summary ").Select
> > >
> > > A message pops up saying, 'Incorrect Password...'
> > > I know the password is correct, I am not sure about the Data Type though.
> > > Can someone please give me some guidance?
> > >
> > > Thanks so much,
> > > Ryan---
> > >
> > >
> > > --
> > > RyGuy

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct Currency Data Type and Validation Coding LisaInAz Microsoft Access VBA Modules 3 4th Mar 2010 08:59 PM
Data Type Mismatch in Expression - can I force a query to read as a diferent data type? S Davis Microsoft Access Queries 1 7th Jun 2007 11:33 PM
Check a column for correct type of data =?Utf-8?B?VFdpbHNvbg==?= Microsoft Excel Programming 1 19th Oct 2006 02:34 PM
type quick and correct Chen Bin Microsoft Outlook 0 2nd Aug 2004 12:04 PM
importing the correct data type george Microsoft Access Form Coding 1 12th Mar 2004 02:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:25 PM.