Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Me.Form.picture

Posted on 2000-04-17
15
Medium Priority
?
211 Views
Last Modified: 2006-11-17
If I bind a button to update the From.picture It doesn't update.
-Adam
0
Comment
Question by:smak070798
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 9

Expert Comment

by:BrianWren
ID: 2724811
This is copy two of this question.  Delete it, or you'll have people answering both, and you'll give up double points, or irritate someone who answers here but has their answer ignored for someone posting the same answer on the other instance.  The other copy is at

http://www.experts-exchange.com/jsp/qShow.jsp?ta=msaccess&qid=10329912 

Brian
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2724869
Please post the code that is on the button.
0
 

Author Comment

by:smak070798
ID: 2724877
Me.form.picture = "Path\picture.ext"
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 9

Expert Comment

by:BrianWren
ID: 2724884
I mean the actual code, from  "Sub . . ."  to  "End Sub".
0
 

Author Comment

by:smak070798
ID: 2724929
Heh, thats about it. What more do I need.  
Private_SUb Command_OnClick()

Me.form.picture = "Path\picture.bmp"

End Sub
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2724958
OK, good.

First, "Path\picture.bmp" is pretty clearly what is called psuedo-code, or P-code.  You must replace 'Path' with the path to the picture that you want on the form, and replace 'picture.bmp' with the name of the bitmap that you want on the form.

When I read your question, and tried the concept to see how it works, I used

   Me.Form.Picture = "C:\LEDs.bmp"

for example.  What you pasted does not have a drive designator, ("C:\," D:\," etc.)   The way you have show would look for a subdirectory off the current default directory, (which is not a stable thing; it can be changed by other programs), and a file in that directory called "picture.bmp".

Second, are you sure that the sub routine is running?  You can have a properly formatted sub routine for a button or control, that still won't actually run because the Property Sheet doesn't have the event set to

  [Event Procedure]

Make sure that the On Click event for the button says [Event Procedure].

Brian
0
 

Author Comment

by:smak070798
ID: 2728018
Hmmm, Brain I really don't know if I should be ticked, or just start laughing. I will assume the later. I am fully aware of psuedo-code and the layout/enviorment of the access functions including private, public, and modules. I even have wrote a few database :P.  
-I will take the blame, it is probably my fault anyway. I wasn't clear enough. I am trying to create a ('Skin') type interface in which the users of my database can scroll through some preset pictures that I have created. Then once the select the picture it will set the background of all of the forms they open to this linked picture. Now, My only fear is that the Me.Form.Picture property is static and not dynamic. Which Means that the form would have to be opened up in design mode, the picture property altered, the form saved and then reopened. This creats a problem in a multiuser enviorment. All the code that I have created to handle the user perferences with dealing with the picture, and controls, and everything else work fine. However, the code below isn't producing my desired results.

'Here is the top portion of the function
'extra stuff that doesn't matter

Me.Form.Picture = "Path\Picture.bmp"
DoEvents

'More code for extra things that don't mater.

In my mind. The code above should have displayed the picture stated in the path as the forms picture. Then updated the form. However it does nothing.
Yes, I also have PictureTiling = True as well so it would be tiled across the form.

Adam
0
 

Author Comment

by:smak070798
ID: 2728037
Add, and Just to make sure...
 Me.Form.Picture = "Path\picture.bmp"   Isn't really the path I am setting too. Its more psuedo-code. :)
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2728192
OK.  (You never know the person's expertise here.)

I tried, in the debug window, while the code was stopped on a 'stop' in the module behind the form,

   Me.Form.Picture = "C:\LEDs.bmp" <Enter>

and immediately the running form got that picture put behind it.  The location left something to be desired, but the picture immediately appeared.

Where in the process of opening the form do you try to establish its appearance?

0
 

Author Comment

by:smak070798
ID: 2728202
It would most likely come from a function called by the Form_Load event
0
 
LVL 9

Accepted Solution

by:
BrianWren earned 200 total points
ID: 2728277
When I set a global string to a valid .bmp, and I set the form's .Picture property to that file, the form shows the picture.

What am I missing here?

In a form I select an entry in a combe box which is either 'Picture1,' 'Picture2' or 'Picture3.'

When I click the OK button, I put that selection into strPic, a global string.

In the form's Load event I have

Private Sub Form_Load()
Me.Form.Picture = "C:\" & strPic & ".bmp"
End Sub

Works like a charm...

Brian
0
 

Author Comment

by:smak070798
ID: 2728427
Hehe, Maybe it is a syntax error on my part. I'll recheck
0
 

Author Comment

by:smak070798
ID: 2728483
Okay use these settings on your form:

Hor.. & Ver.. scrolls off
record nav off
Modal
Popup = true
and boarder style = thin


Now  will notice it will not change.

Now change your boarder to sizeable. After u click to change ur backgroung resize the from using the  boarder. You will notice the background update then.  

Not even Me.refresh works.
0
 

Author Comment

by:smak070798
ID: 2728713
Never mind. I am having problems with the tab control. I see whats going on and fixed it. Here I'll give u the points tho.
Later Adam
0
 
LVL 9

Expert Comment

by:BrianWren
ID: 2731818
Thanks.

BTW,
When you give a grade of A for a 100 pt Q, it costs you 100, & the recip gets 400.
When you give a grade of B for a 100 pt Q, it costs you 100, & the recip gets 300.
When you give a grade of C for a 100 pt Q, it costs you 100, & the recip gets 150, (I think...).

But listen, really, I mean it nonetheless when I say thanks.

What was the problem with the tab control?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question