Solved

Me.Form.picture

Posted on 2000-04-17
15
163 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now