Me.Form.picture

If I bind a button to update the From.picture It doesn't update.
-Adam
smak070798Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BrianWrenConnect With a Mentor Commented:
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
 
BrianWrenCommented:
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
 
BrianWrenCommented:
Please post the code that is on the button.
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
smak070798Author Commented:
Me.form.picture = "Path\picture.ext"
0
 
BrianWrenCommented:
I mean the actual code, from  "Sub . . ."  to  "End Sub".
0
 
smak070798Author Commented:
Heh, thats about it. What more do I need.  
Private_SUb Command_OnClick()

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

End Sub
0
 
BrianWrenCommented:
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
 
smak070798Author Commented:
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
 
smak070798Author Commented:
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
 
BrianWrenCommented:
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
 
smak070798Author Commented:
It would most likely come from a function called by the Form_Load event
0
 
smak070798Author Commented:
Hehe, Maybe it is a syntax error on my part. I'll recheck
0
 
smak070798Author Commented:
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
 
smak070798Author Commented:
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
 
BrianWrenCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.