Reference control unless focus problem

I have a form that opens in the edit mode. I have an unbound image control 
and a bound textbox with the path to the picture stored in the table. I want 
the picture to display on each record as I scroll through the records. I have 
the following code in the OnCurrent property of the image control (EditPic). 
When I open the form I get the following message: 

"You can't reference a property or method for a control unless the control 
has the focus." How can I make this work correctly. Thank you.


Private Sub Form_Current()
   Me.EditPic.Picture = Me.txtPicPath.Text
End Sub

0
Utf
11/11/2007 10:12:01 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
1651 Views

Similar Articles

[PageSpeed] 44

"Billy B" <BillyB@discussions.microsoft.com> wrote in message 
news:F53DA692-494D-46E7-9192-57160E666517@microsoft.com...
>I have a form that opens in the edit mode. I have an unbound image control
> and a bound textbox with the path to the picture stored in the table. I 
> want
> the picture to display on each record as I scroll through the records. I 
> have
> the following code in the OnCurrent property of the image control 
> (EditPic).
> When I open the form I get the following message:
>
> "You can't reference a property or method for a control unless the control
> has the focus." How can I make this work correctly. Thank you.
>
>
> Private Sub Form_Current()
>   Me.EditPic.Picture = Me.txtPicPath.Text
> End Sub

Replace .Text with .Value

The text property of a control is only available when the control has the 
focus, but the value property is available at all times.



1
Stuart
11/11/2007 11:13:54 PM
Reply:

Similar Artilces:

Cell Value as Named Range Reference
Little bit of a quirky question... Trying to use a cell value as a reference in a formula, where that cell value is the name of a named range. So, assume A1:A3 is a named range: Rng1. And, B1:B3 is Rng2. I want to get the correlation vale for A1:A3 and B1:B3 So, cell D1 contains "Rng1" and D2 has "Rng2"; and cell D3 has the formula: =correl(D1,D2). But I get an error. Have also tried using Indirect to no avail. Any help would be hugely appreciated. Thank you. =CORREL(INDIRECT(D1),INDIRECT(D2)) -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "ste...

Outlook and Word 2003 editing and error problem
This is a problem happened on a company PC that IT controls the updates (security, anti-virus) in the night. One day morning, I started having the problems below. I didn't install anything before, but was sure something was installed by company IT that early morning. I turned off the PC and it was on the next day. problems: 1. I can't use mouse to move the cursor to a specific location in the editing window, but I can on the header (to:, subject). I have to use arrow keys to navigate when editing. 2. I can't launch Word whenever Outlook is open. Once Outlook is quit, Wo...

Need to reference a block of cells from another sheet.
Dear All, apologies if this is probably a mundane question, but I didn't know what 'search terms' to put in google to return any results.. I've got a Spreadsheet with 12 tabs (sheets), I need part of tab 12 (sheet) to appear on tabs 1-11 (sheets), so that if I change data in tab 12 (sheet), tabs 1-11 (sheets) are changed too.. the cells themselves will never move location, just the data within them.. Is it possible? Regards Paul. On your sheet1 select the cell that should receive the data from Sheet12; Hold down the Shift key and Click on Sheet11 << this shoul...

Outlook problem #50
Hello,im using outlook web access and my problem is i can'n get a reply dialog box when i want to reply back the msge.I can click on reply,reply to all or forward but i can't get to the dialog box.Please Help. ...

refering to a name range area as a reference value multiple times on a worksheet at different locations
i was wondering if i had posted this in the right section as it could apply to both please could you take a look at the following post http://groups.google.com/group/microsoft.public.excel.misc/browse_thread/thread/f088a5737dd26570 thank you Is there some reason you can't post your question here instead of asking us to look elsewhere? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Blinds Nottingham" <bradrail.blinds.awnings@googlemail.com> wrote in message news:d8768e43-e035-45eb-856a-0ccdc843441d@g1g2000yqi.googlegroup...

password problem
We've been using Money 2002 for some time with no problems. Today I decide to protect the file by assiging a password. Now I can't access Money. I click on it and nothing happens. No prompt...nothing. Help! I'd appreciate any tips you can give me. In microsoft.public.money, kl wrote: >We've been using Money 2002 for some time with no >problems. Today I decide to protect the file by assiging >a password. Now I can't access Money. I click on it and >nothing happens. No prompt...nothing. Help! I'd >appreciate any tips you can give me. Keep extra c...

Could someone please help me with a solution to my problem?
Could someone please help me with a solution to my problem...? In column X I have finishing position last run In column Y I have finishing position penultimate run What I am trying to do is find how many times the finishing position in both the last run and penultimate run was 1st 2nd or 3rd I have been trying this formula... =SUMPRODUCT(('Cheltenham 1992-2010'!$X$2:$X$820<=3)*('Cheltenham 1992-2010'!$Y$2:$Y$820<=3)) but it appears to be returning all instances of finishing position equal or less that three, where I only want it to return when the fini...

What is IVA# in Distribution Reference and Reference?
We did an inventory adjustment and now we get a unknown amount in Debit under the Inventory account and Credit for COGS account in the Transaction Entry Zoom. We're trying to figure out where that amount came from but we couldn't zoom more than what it's currently shown. In both fields, Reference and Distribution Reference, it's shown IVA#######... that is unknown to or setup by us in anywhere, i.e. Audit Trail, Source Document. Does this amount affect the dollar in the accounts mentioned? And can anyone please help to where we could drill down the IVA details?...

Huge problem with Big Bosses mailbox
Hi all I have exc2003 and xp pro. Our big boss had her mails in a .pst. her size was 2.5GB. this was a archived folder. She had a mailbox on the exchange with a limit of 100MB. I had to move all her mail to the exchange mailbox. If i want to change her mailbox size exchange says that the max size in KB is 2097151. If i enter this as her size she cannot send and get this message... Your message did not reach some or all of the intended recipients. Subject: test Sent: 10/17/2006 3:02 PM The following recipient(s) could not be reached: Craig Meyer on 10/17/2006 3:05 PM The message fail...

Displaying controls for different monitor display format settings
Hi, I want to display a CButton (o_Verwijderen) control at the left bottom of my form for all display formats. I have : void CTBURView::OnInitialUpdate() { CFormView::OnInitialUpdate(); ShowWindow(SW_SHOWMAXIMIZED); long x,y; x = ::GetSystemMetrics(SM_CXSCREEN); y = ::GetSystemMetrics(SM_CYSCREEN); CRect o_Rect; o_Verwijderen.GetClientRect(o_Rect); o_Verwijderen.MoveWindow(10,(int)(y*0.81),o_Rect.Width (),o_Rect.Height ()); This works only for the highest display format setting 1280x1024 and for 1280x960 but for lower settings the button moves of screen. How do display my but...

macro button refers to prev. workbook?
Hi, When I create a macro in Excel, and assign a button to it, it works fine the first time, but when I re-open the workbook for a second time, and try to run the macro again, the macro seems to refer to the previous workbook...For some reason, the macro saves the name of the previous workbook... Sub test() ' Dim name As String Dim adress As String Sheets("sheet1").Select Range("A1").Select name = ActiveSheet.Range("B6").Value adress = ActiveSheet.Range("B4").Value ActiveWorkbook.SaveAs Filename:="C:\WINDOWS\Desktop\Temp...

problems with eps file type
Hello I am attempting to create my business card in Publisher. My logo's are eps files. Publsiher would not show the logo image (I guess the logo image did not have a tiff preview file embedded). I would like to upload my finished business card as an eps file type. The online printers do not accept ps file type. Can I simply change the ps extension to eps? If Publisher does not work well with eps file types (which appear to be an industry standard) then what other program should I consider using? I am baffled at how difficult this effort has been - My guess is that eps is perhaps...

auto insert date upon change of a control
Hey all.... I have a form (in continuous form view) which has a combo box for order status. I would like to automatically create a date whenever someone changes the status of an order. So, I imagine I would create a seperate table called, say...update status date a which contains 2 fileds (Order Number and Status Change Date). How do I get the Order Number and Status Change Date record into the new table whenever the staus is changed? Thanks in advance!!! Use the events of the form to insert a record into your logging table. You will need to use Form_BeforeUpdate and Form_AfterUpd...

The messaging interface has returned an unknown error. If the problem persists, start Outlook again.
Microsoft Article Q172350 sort of helps me with my Delema... I have a Windows XP SP2 with Office 2003 SP1. The client is able to Print her own Calendar but when she tries to Print a Shared Calendar she has Access to and can Read, She gets the Error: "The messaging interface has returned an unknown error. If the problem persists, start Outlook again. " I tried to do a Office repair and this did not help. I do not really want to put Office SP2 on machine as of yet... Any idea... thanks in advance... Michael Re: The messaging interface has returned an unknown error. If th...

Column and Row reference
How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top and right hand side references Dave Tools>Options>View. Uncheck "row and column headers". Good idea to spend a few minutes browsing through the various Tools>Options tabs to see what else is available to toggle on/off. Gord Dibben Excel MVP On Mon, 19 Jul 2004 15:53:02 -0700, "Dave" <Dave@discussions.microsoft.com> wrote: >How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top an...

Workflow duplication problem (CRM 3.0)
I have the following pretty simple rule When account is assigned email to: [Owner] Subject: You have been assigned a new account (Create Task)Phone Call: Follow up call for new Account Stop The problem is that it is running multiple times....like 3-4 times. Can anyone explain why and what to do about it? ...

Missing References
I had a problem today with a missing reference - Microsoft Forms 2 on a colleague's machine at work (Office 2003; VBA 6.5; XP). I've read Chip Pearson's "Missing References in VBA" which is a geat explanation about how to fix problems like this. Oddly the library didn't seem to be flagged as "missing" and was in fact present in the system32 directory but didn't show up in the list of available references. Now to the questions: I'm not clear on whether if I write code in a project that references a library which is not part of the &qu...

My Publisher is "out of control writing 'gibberish' code .........
How do i fix this problem. When I open Publisher 2003, it loads and then begins to write what appears to be code. It is out of control, writong this 'gibberish',and then at the bottom, where the pages are shown, it loads page after page of this dang crap?!?!? Does anyone know what is happening to me??????? M. Slowruner R. Has this always happened with Publisher? Have you tried to uninstall and reinstall it? -- JoAnn Paules MVP Microsoft [Publisher] "slowrunner" <anonymous@discussions.microsoft.com> wrote in message news:010801c49383$d0ded5c0$a401280a@phx.gb...

Make pasted value in last blank cell the focus
Whichever cell has the focus when the following code is run that is the row that will be copied into any other sheet in the range. What I need is the row containing the last blank cell in "B" in which the value of "B9" take the focus, although the exact row to be copied wont be determined until the sheet has first been sorted. Here is the code in it entirety: Option Explicit Option Compare Text Private Sub AddRow_Click() Dim rng As Range Dim lr As Long Dim sh As Worksheet Dim ws As Worksheet Dim i As Integer Dim FD As String 'find string ...

Outlook problem with XP SP2
I have recently installed Windows XP SP2. Since installing it Outlook will only send email via the account that was the default at the time SP2 was installed regardless of the account selceted from the 'Accounts' dropdown. Outlook refuses to send any email at all if the account in question is removed. Any Thoughts? ...

Tab Control 02-27-10
On a form. is there a way to get a tab control with a vertical scrollbar? If not, I'll have to use a sub-form (but I'd rather not). Thanks. bob In a word, "No." Sorry. One of the purposes of Tabbed Controls is to avoid having to scroll down a form. You could use a subform on the Tabbed page. -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1 Thanks. I want to have a small area of the form scroll-able...

Reference
Is it possible to create a reference to another object such as: int & x = i; but using an image list, and referencing different objects depending on a condition? such as : CImageList & imageList; if (thumbnail == 1) imageList = m_ImageListThumb; else imageList = m_ImageListFullSize; Hope this makes sense! Ben You're better off using pointers for this. I believe, depending on the class, that what you're trying to will make a copy of the object instead of referencing it. "Ben Williamson" <oakdaleclose@googlemail.com> wrote in message news:43ee4603...

Macro to Reference Column Next to Current Reference
Hi, I'd like to automate the following procedure using a macro. Please help. 1) i have 2 sheets: Sheet1 & Sheet2 2) In Sheet1, Cells B2,D2,F2 has the formulas "=Sheet2! F2", "=Sheet2!K2", "=Sheet2!P2" correspondingly. 3) Every month when i do my work, i'd have to manually rekey the formulas to reference the subsequent columns, ie, Cell B2,D2,F2 will change from above to "=Sheet2! G2", "=Sheet2!L2", "=Sheet2!Q2" and in the following month, I have to change manually again to "=Sheet2! H2", "=Sheet2!M2&qu...

Sheet Reference
Is there a formula for listing the current Sheet. I know about the filename cell("filename",A1) which returns the entire path, but I just want the Sheet name to appear. John, You still use the CELL("filename") function, but you need to trim the result a bit. Like this: =MID(CELL("filename"),FIND("]",CELL("filename"))+1,99) -- Ture Magnusson Microsoft MVP - Excel Karlstad, Sweden "John" <anonymous@discussions.microsoft.com> wrote in message news:0c6001c3a856$291c9a20$a501280a@phx.gbl... > Is there a formula for listing...

R1C1 reference #2
Excel keeps changing to the R1C1 reference style, but only in one of my workbooks (I believe in just one of the worksheets). I keep changing it back (Tools - Options - General - R1C1 Reference Style), but when I move or copy cells in the workbook, it changes back to R1C1. Anyone have an idea? Look at the TOOLS / OPTIONS / SETTINGS is the 'R1C1 References Style' box checked? If not, check it then save the workbook. Not sure if this is your issue but it's worth a try. Good Luck, -- Gary Brown gary.DeleteThis2SendMeAnEmail.Brown@kinneson.com "Tony S" wrote: > Ex...