programtically change an Embedded picture of a command button

I'd like to prgramatically change the Embeded picture of a command button.

I don't want to use a linked picture because the application is portable and 
I don't want to have to copy the image along with the .mdb

Anyone have sample code for this?
0
Utf
4/1/2010 3:26:07 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
4275 Views

Similar Articles

[PageSpeed] 37

Have an invisible CommandButton of the same size with the required image 
embedded, then use the PictureData property.
Me.cmd1.PictureData = Me.cmd2.PictureData should do it.

-Jon

"TADropik" <tom@sportmutt.com> wrote in message 
news:0BBECB0B-06BB-42D4-8FA4-7B0565E84E7E@microsoft.com...
> I'd like to prgramatically change the Embeded picture of a command button.
>
> I don't want to use a linked picture because the application is portable 
> and
> I don't want to have to copy the image along with the .mdb
>
> Anyone have sample code for this? 


1
Jon
4/1/2010 4:30:06 PM
On Thu, 1 Apr 2010 08:26:07 -0700, TADropik wrote:

> I'd like to prgramatically change the Embeded picture of a command button.
> 
> I don't want to use a linked picture because the application is portable and 
> I don't want to have to copy the image along with the .mdb
> 
> Anyone have sample code for this?

Probably quicker to simply open the form in Design View and change the
button's Picture property manually as you do need to have the picture
somewhere on the computer to set it as the button's picture, and it
will be faster than writing the below code.
However ...

Code a module

DoCmd.Echo False
DoCmd.OpenForm "FormName", acDesign, , , acFormPropertySettings,
acHidden
Forms!FormName!cmdButtonName.Picture =
"C:\PathToFolder\PictureName.ico"
DoCmd.Close acForm, "FormName", acSaveYes
DoCmd.OpenForm "FormName"
DoCmd.Echo True


-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
4/1/2010 4:34:49 PM
Reply:

Similar Artilces:

Can I change the calendar year beginning date?
Our fiscal year runs July 1 thru June 30 of each year. I need to track attendance, gas cards, etc for monthly reports. I have a HUGE table with a gazillion queries and reports for each one. I need one report to reflect quarterly output for our fiscal year as stated above. Can I make this report do that? Thank you! Create a query to use as the source for your report. In query design, type this into the Field row: FinYear: DateAdd("m", -6, [InvoiceDate]) replacing InvoiceDate with the name of your date field. This yields 2007 for all dates in the 2007/2008 financial year...

change horizontal header position in excel
Anyone know how to change the horizontal position of the HEADER or FOOTER in EXCEL???? I would greatly appreciate any help. Thank you for your time. pico Wrote: > Anyone know how to change the horizontal position of the HEADER o > FOOTER in > EXCEL???? I would greatly appreciate any help. Thank you for your time. Pico, Can't you go into View/Header-Footer and use the "Left-Center-Right" catagories? You could use spaces in front of your data to move back an forth. Dav -- Piranh ----------------------------------------------------------------------- Piranha's Profi...

Does Word have a command that compares to WordPerfect Advance?
I want to advance text to a specific position within the line that is independent of the number of characters that precedes it. Tab will not work as it measures from the preceding character. WordPerfect has a command: "Typesetting" "Advance" that I use for this. Is there a comparable command in MS Word? Word does have an Advance field, mostly for compatibility with documents imported from WordPerfect. If you use the \x switch, it will position the next character at the specified location. According to the help topic on the Advance field, the \x switch &qu...

Why is Excel changing the last 2 digits of a 17 digit num to 00.
When I enter a 17 digit number in a cell in Excel, the last 2 digits turn to 00 when I leave the cell. Format - Cell does not have a setting to stop this 'feature'. How do I make Excel recongize the large number? On Thu, 28 Jul 2005 19:09:01 -0700, "Allie" <Allie@discussions.microsoft.com> wrote: >When I enter a 17 digit number in a cell in Excel, the last 2 digits turn to >00 when I leave the cell. Format - Cell does not have a setting to stop this >'feature'. Excel Specifications and Limits: Calculation specifications Feature Maximu...

Detect page change in PropertySheet?
Hi, I have a property sheet that is the parent of several property pages. If the user clicks a tab to change to another page, is there a way I can detect this (and possibly prevent the change) in the PropertySheet dialog? Does windows/MFC send any kind of message to the PropertySheet dialog? I looked at all of the over-rides and WM_ message, but cannot see anything. Thanks! Not directly. You can catch that in the CPropertyPage and relay the message to the CPropertySheet. (I know you are asking, why doesn't the CPropertySheet get the notificatio first? who knows!) AliR. "...

Changing e-mail address
dI´m trying to change mail-address in AD-Users and computer. From "nnnn@xxx.xx" to "nnnn@yyy.xx", but it won't work. On the tab "e-mail Addresses" i try to set "nnnn@yyy.xx" as Primary, but it don't stay that way. If I open directly and check it seems right, but close and do one more client, the first has change back to "nnnn@xxx.xx". What am I doing wrong ???????? You will need to uncheck the checkbox "Automatically update e-mail addresses based on recipient policy" for the change to stay. Also make sure that you ...

... I want to change a chart type ...
I have a "Line - Column" chart in my spreadsheet. My Bars represent the month which is in a Linked Cell. The Value of the Bars is a Dollar amount from a Linked Cell. The Line represents a Target Dollar Value. I would like to add a second line that would represent a count from a linked range of cells. Can I edit my existing chart, or do I have to create a new one? Could you give me a few pointers? Darrell Select and drag the new column onto the chart. In the resulting dialog box, ensure you specify 'new series'. Once XL finishes adding the series, if it is not the...

Changing fonts in msgbox
If i create a msgbox with a prompt, can i change or modify the font of the text in the msgbox ?? Ditto Inputbox.... thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ You can't change the font used in a MsgBox. This limitation is one of the prices you pay for the simplicity of a MsgBox. If you need to change the font, you need to create a UserForm and display that form instead of using a MsgBox. -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpears...

Change of field separator
When I open CSV files in Excel all data is put in one column. Can anyone tell me, where I change my set up, so I get another field separator? Please be specific, because my Excel is a Danish version, and sometimes I have a hard time following the English instructions. Thanks! Jane Hi you specify this in the Windows regional settings. Another idea: - rename your *.csv file to a *.txt file - now open it with excel. The Import wizard should appear and should allow you to specify a different delimiter "Janepige" wrote: > When I open CSV files in Excel all data is put in one co...

Middle mouse button does not always open in new tab anymore
Hi! I am experiencing the problem that when I click with the middle mouse button on a link (for example google search results) it does not always open it in a new tab anymore. In about 20% of the cases it takes over the current tab instead. The same problem is explained here in german: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.de.internetexplorer&tid=cd463718-8df6-4ee4-9e8a-9ee527837f83&cat=&lang=de&cr=DE&sloc=&p=1 But since there was no answer found so far I decided to take it to the next level (english c...

Paper settings change for specific printer
I just installed access 2007 and my application uses reports to print labels. Specifically a Dymo turbo 400 and 30252 address labels. when i was using acess 2003 i specified to use a specific printer and everything was great. and when i copied updated FrontEnds to my networked computers every thing transfered and the labels printed fine however with 07 the "Specifc printer" has a different page size.. i fixed all the reports on my master FE but the changes didnt stay when i copied FE to other computers and im not sure where to go. i installed all the printers from the s...

Prevent users from saving music and pictures to their hard drives without folder redirection?
Hi there. I'm wondering if there is a way via GPO or anything else to prevent users from saving music and pictures to their local hard drives without using any type of profile or folder redirection. Thanks. ...

How do I change numbers to negative without re-typing?
I have a large range of data that needs to be changed to negative numbers, Can I do this in Excel? ...

Adding a button with a function on protected sheets.
How do i add a button to 'reset/clear' the data on a worksheet that is protected and uses VLookup data (from another worksheet). Everyday this table will have data chosen from combo boxes or manually entered in allowable editable fields and at the end of the day after the files is saved, I need to clear that data for use on the next day. How is this Reset button applied with allowable edit ranges, VLookup data and a protected worksheet? Thanks There's several ways to do this. 1. Instead of straight vlookups, use =IF(ISBLANK(VLOOKUP(....)),"",VLOOKUP(....)) wher...

command for breaking link in excel is not seen.
i have copied files containing fromulas to another file. while opening the new file, each time, it is asking whetehr to update the data from parent file. I wish to break the link in second file, but could not find the command for that. while opening links, it shows only three commands, which odes not include command for ' breaking links'. Hi Suresh, If the links are no longer required, delete the link formulae or convert them to values. You may find Bill Manville's FINDLINK.XLA addin useful This is freely downloadable at: http://www.oaltd.co.uk/mvp --- Regards, ...

Routing Restrictions button unavailable (gray) no matter what options selected in IMS-->Routing tab
I am running Exchange 5.5 SP4. In Connections-->IMS-->Routing Tab, my "Routing Restrictions" button is unavailable (greyed-out) no matter what options I select. Any suggestions? Thank you. Try installing Exch Admin prog on other machine, apply SP4 and see if you can change it from there. Post back with details. ryanadmin wrote: > I am running Exchange 5.5 SP4. In Connections-->IMS-->Routing Tab, my > "Routing Restrictions" button is unavailable (greyed-out) no matter > what options I select. Any suggestions? Thank you. ...

How to Change Outgoing port in Exchange 2003
I am running Exchange 2003 on a SBS 2003 server and using the POP3 connector to get the e-mail from my account and also send the email out throught the SMTP server. Starting last Friday the outgoing mail is not being sent. Earthlink tells me that they are now using port 587 for the outgoing mail. How do I change the outgoing mail SMTP port? Thanks -- Don Holden -- Don Holden On Mon, 26 Jun 2006 09:07:02 -0700, Don Holden <DonHolden@discussions.microsoft.com> wrote: >I am running Exchange 2003 on a SBS 2003 server and using the POP3 connector >to get the e-mail from my...

grayscale autoshape changes to color when converting to PDF
When converting from Microsoft Publisher 2007 to Adobe Acrobat 8.0 PDF, the autoshape picture that we changed to grayscale changes back to color when reviewing the created PDF. Are you setting Acrobat to print in black and white? Select the PDF printer, properties, paper/quality tab. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "CDJ" <CDJ@discussions.microsoft.com> wrote in message news:6BE9EE01-97DB-4AB6-BD9C-25E27E0BB68D@microsoft.com... > When converting from Microsoft Publisher 2007 to Adobe Acrobat 8.0 P...

Picture in message appears bigger than original
I'm using Outlook 2003. I have this problem with adding pictures in messages. When ever I add a picture in a message(not as attachment), the picture looks much bigger than it actually is. The funny thing is that, when I check the size of the image in the message it shows to be the same size as what it should be, say 1 inch height and width. But looking at it in the message it looks like it's about 30% bigger. I don't want to adjust the pic everytime I send a message with a pic pasted in it. I'm using winxp pro as well. Any suggestions? Thanks for helping. Pri...

Outlook changing PDF extention to PDF=
I have a client that uses Outlook 2000 for e-mail. About a week ago, she started complaining that everyone that she sent PDFs (Ex. Document.pdf) that they were receiving PDF= (Ex. Docuement.pdf=). This is only happening with PDF files, not word documents or anything else. I have tried to change the outgoing mail server, but that made no difference. Is there something in Outlook that can be causing this? is she using RTF formatted messages? Antivirus or antispam scanners on outgoing email? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2...

Preventing changes in the Options
Hello, Is there a way in Excel to prevent users from making any changes in the Options (ie protect or disable the Options Dialog box). Thanks in advance, brgds, Chantal ...

How to change the FROM field in email campaign activity?
How to change the FROM field in email campaign activity? I would like to create an email campaign activity and change the TO field of the email to be abother name instead of mine I would also like to add attachments I can't find a way to do this Any help is very much appreciated Thank you Stella Hi Stella, There are many ways to send marketing emails from CRM: Quick Campaigns Quick Campaigns with mail merge using Microsoft Word E-mail Campaign Activities E-mail Campaign Activities with mail merge using Microsoft Word Direct e-mail using templates Send a workflow e-mail Integrate...

font change when editing
I have this I can place on the sheet module to change font when editing. Is there a way to put this into a macro so I can enter this into the sheet automatically each time I am emailed a new version of the workbook? Thanks. Private Sub Worksheet_Change(ByVal Target As Range) Target.Cells.Interior.ColorIndex = 4 End Sub ...

Using BGInfo Command Line Parameters
I've read the Help file in BGInfo - but can't figure out how to use Command Line Parameters. When I click on my startup icon, I would like to invoke certain parameters. The line I came up with is: "C:\Program Files\BGInfo\BgInfo\Bginfo.exe /timer:99 /popup /taskbar /rtf:C:\DATA\BGINFO /nolicprompt" Obviously, this is wrong. My Target line reads: "C:\Program Files\BGInfo\BgInfo\Bginfo.exe" My Start in line reads: "C:\Program Files\BGInfo\BgInfo" Please help me by telling me what, exactly, should go in each line. I would also like t...

anchor picture to text box
(Publisher 2003) I have a newsletter with a Kudos box. In the corners of the box I have a happy face. I'd like the happy faces to be anchored to their corners so when I enlarge or shorten the box, the faces move along with the text box. Why not create a rectangle, insert the happy faces, group. The problem as I see it would be if you resize, the happy faces could be distorted if you widen or shrink the group. You would always have to re-size proportionally. -- Mary Sauer http://msauer.mvps.org/ "Helen" <Helen@discussions.microsoft.com> wrote in message news:193...