|
-
Jan 14th, 2000, 10:48 PM
#1
Thread Starter
Member
I am having a problem. I am trying to make a program with 200 plus pictures and a database. I have successfully been able to get the pictures related to the data to load in a click event but i cannot in the form load page here is an example. When the database loads the name in the lable then the picture is supposed to load.
Private Sub Form_Load()
Select Case "lblname"
Case "1997 Holiday Teddy"
'1997 Holiday Teddy Picture
If lblname = "1997 Holiday Teddy" Then
Picture1.Picture = LoadPicture("C:\My Documents\Project\Babies\97teddy3_small.jpg")
End If
End Select
End Sub
I have checked the path just to make sure i mispelled or misdirected the path but i havent do any of you have any ideas? thanks
-
Jan 15th, 2000, 01:31 AM
#2
Member
In your Select Case statement, take off the quotation marks around it.
Select Case lblname
------------------
David Underwood
Teen Programmer
ICQ - 14028049
E-mail - [email protected]
[This message has been edited by X_Darknight_X (edited 01-15-2000).]
-
Jan 15th, 2000, 01:59 AM
#3
Member
So your code looks like this right?
Private Sub Form_Load()
Select Case lblname.Caption
Case Is = "1997 Holiday Teddy"
'1997 Holiday Teddy Picture
Picture1.Picture = LoadPicture("C:\My Documents\Project\Babies\97teddy3_small.jpg")
End Select
End Sub
If that still doesn't work then the caption <> "1997 Holiday Teddy" or you're referred to the wrong label.
Private Sub Form_Load()
Select Case lblname.Caption
Case Is <> "1997 Holiday Teddy"
'1997 Holiday Teddy Picture
Picture1.Picture = LoadPicture("C:\My Documents\Project\Babies\97teddy3_small.jpg")
End Select
End Sub
------------------
David Underwood
Teen Programmer
ICQ - 14028049
E-mail - [email protected]
[This message has been edited by X_Darknight_X (edited 01-15-2000).]
-
Jan 15th, 2000, 09:50 AM
#4
Member
Do you have any text in the label's caption property? I mean, when you press play, is there any preentered text already in the label's caption property? Also, only 1 picture should display because you're only checking the status of lblnames.Caption.
Where is the "1997 Holiday Teddy" and "1998 Holiday Teddy" text coming from? I know it's in the label but how is the text getting there? Whatever happening, when the form_load event is triggered, the caption is not equaling "1997 Holiday Teddy".
------------------
David Underwood
Teen Programmer
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:06 AM
#5
Member
Whew....hmmmmm, well then try this:
Private Sub Form_Load()
Select Case Trim(lblname.Caption)
Case Is = "1997 Holiday Teddy"
'1997 Holiday Teddy Picture
Picture1.Picture = LoadPicture("C:\My Documents\Project\Babies\97teddy3_small.jpg")
Case Is = "1998 Holiday Teddy"
'1998 Holiday Teddy Picture
Picture1.Picture = LoadPicture("C:\My Documents\Project\Babies\98teddy_small.jpg")
End Select
Maybe there's some extra spaces being added at the end or at the beginning of the text.
We're going to figure this out!!!
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:27 AM
#6
Thread Starter
Member
tried the trim with no luck does the trim take out any extra spaces? Well next stage of frustration for us all 
-
Jan 15th, 2000, 10:31 AM
#7
Member
Ok where are you assigning the name of the teddy bear, in the database, to the label? And what's the code you're using?
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:33 AM
#8
Thread Starter
Member
im using the data field in the properties of the label is that how i should do i or is it easier doing it the manual way
-
Jan 15th, 2000, 10:37 AM
#9
Member
I'm not really familiar with databases....
When the form loads up, is there anything written in the label?
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:39 AM
#10
Thread Starter
Member
i take that back yes there is the first name in the database
-
Jan 15th, 2000, 10:40 AM
#11
Member
Then how can you check in the form_load if the label = "1997 Holiday Teddy" when there's nothing in the label?
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:55 AM
#12
Member
I assume somehow the text in the labels caption changes because you have multiple cases equaling different things. Like
Case Is = "1997 Holiday Bear"
Case Is = "1998 Holiday Bear"
When is the text supposed to change? Does the user do it somewhere in the program?
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 10:56 AM
#13
Thread Starter
Member
yes there is a data control which changes the name in lblname
-
Jan 15th, 2000, 11:00 AM
#14
Thread Starter
Member
Dark Knight I GOT IT!!!!! I switched all the code to the data control and it works
thank you so very much you dont know how much you have helped me
hey i have you on icq im computercowboy when you ever get on icq next
-
Jan 15th, 2000, 11:04 AM
#15
Member
I was wondering why you were putting it in the form load......I'm glad I could be help, even though it took us a while to figure it out.
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 11:05 AM
#16
Thread Starter
Member
just have to do a little tweaking
it loads the picture like one late and doesnt go back very easy but im sure ill figure it out
-
Jan 15th, 2000, 11:10 AM
#17
Member
Just make sure you clear the picturebox before you load other pictures into it.
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 11:12 AM
#18
Thread Starter
Member
do i do the loadpicture ("") after each case then or what?
-
Jan 15th, 2000, 11:20 AM
#19
Member
Yep
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 15th, 2000, 11:53 AM
#20
Thread Starter
Member
can i ask one last question. My pictures are loading fine, except for one thing they are loading one late like back in the code the #1 bear picture would load in the 1997 Employee bear picture and so on any questions. It also has trouble going backwards as well.
-
Jan 15th, 2000, 12:03 PM
#21
Addicted Member
Try refreshing the form in the end of Form_Load.
I.E.: Fomr.Refresh
------------------
Jorge Ledo
[email protected]
Portugal
-
Jan 15th, 2000, 12:09 PM
#22
Hyperactive Member
also, in your code, you've done
select case "lblname"..
then..
if lblname = "1997 Holiday Teddy"
you dont need the if ; youve checked it already through select case
------------------
cintel rules 
www.cintelsoftware.co.uk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|