Form Code help

Hi can someone please help with this?  Trying to understand why this is not 
running? I have one other control on my form with the same code and it runs 
just fine.   When I make a change on the form it will ask for a parameter and 
then debugs with the following highlighted.   Thank you for any help you can 
provide.

DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" & _
            Forms![frm Provider Tracking].[Contactperson] & "' WHERE 
([Tracking].[ID])= " & _
            Forms![frmPRTrckg].[ID]




Private Sub Contactperson_AfterUpdate()
    If MsgBox("Propagate Contactperson change?", vbYesNo) = vbYes Then
        'MsgBox ("yes:  " & "UPDATE [Tracking] SET 
[Tracking].[Contactperson] = '" & _
            Me.PRVDR_PH & "' WHERE ([Tracking].[ID])= " & Me.PRVDR_ID)
        'run a query to update
        DoCmd.SetWarnings False
        DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" 
& _
            Forms![frm Provider Tracking].[Contactperson] & "' WHERE 
([Tracking].[ID])= " & _
            Forms![frmPRTrckg].[ID]
        DoCmd.SetWarnings True
        
    Else
        'do nothing
    End If
    
End Sub

0
Utf
1/11/2008 4:26:03 PM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
439 Views

Similar Articles

[PageSpeed] 59

"TotallyConfused" <TotallyConfused@discussions.microsoft.com> wrote in 
message news:3781E497-4FC8-4BF3-A638-679E41B54CD9@microsoft.com...
> Hi can someone please help with this?  Trying to understand why this is 
> not
> running? I have one other control on my form with the same code and it 
> runs
> just fine.   When I make a change on the form it will ask for a parameter 
> and
> then debugs with the following highlighted.   Thank you for any help you 
> can
> provide.
>
> DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" & _
>            Forms![frm Provider Tracking].[Contactperson] & "' WHERE
> ([Tracking].[ID])= " & _
>            Forms![frmPRTrckg].[ID]



Are "frm Provider Tracking" and "frmPRTrckg" supposed to be the same form? 
If so, one of those names is wrong.

What parameter does it ask you for?

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

0
Dirk
1/11/2008 6:05:20 PM
Thank you.  Yes the forms name should be the same - fixed that.  But it is 
still prompting me for Contactperson.  What is wrong?

"Dirk Goldgar" wrote:

> "TotallyConfused" <TotallyConfused@discussions.microsoft.com> wrote in 
> message news:3781E497-4FC8-4BF3-A638-679E41B54CD9@microsoft.com...
> > Hi can someone please help with this?  Trying to understand why this is 
> > not
> > running? I have one other control on my form with the same code and it 
> > runs
> > just fine.   When I make a change on the form it will ask for a parameter 
> > and
> > then debugs with the following highlighted.   Thank you for any help you 
> > can
> > provide.
> >
> > DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" & _
> >            Forms![frm Provider Tracking].[Contactperson] & "' WHERE
> > ([Tracking].[ID])= " & _
> >            Forms![frmPRTrckg].[ID]
> 
> 
> 
> Are "frm Provider Tracking" and "frmPRTrckg" supposed to be the same form? 
> If so, one of those names is wrong.
> 
> What parameter does it ask you for?
> 
> -- 
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
> 
> (please reply to the newsgroup)
> 
0
Utf
1/11/2008 6:29:01 PM
"TotallyConfused" <TotallyConfused@discussions.microsoft.com> wrote in 
message news:43F28153-8132-4903-A2FF-7C1EB65C7571@microsoft.com...
> Thank you.  Yes the forms name should be the same - fixed that.  But it is
> still prompting me for Contactperson.  What is wrong?
[...]
>> >
>> > DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" & _
>> >            Forms![frm Provider Tracking].[Contactperson] & "' WHERE
>> > ([Tracking].[ID])= " & _
>> >            Forms![frmPRTrckg].[ID]

Check to make sure that "Contactperson" is actually the name of the field in 
the Tracking table, and is spelled correctly.

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

0
Dirk
1/11/2008 6:34:24 PM
Thank you very much for your help.  The contactperson was misspelled.  Thank 
you

"Dirk Goldgar" wrote:

> "TotallyConfused" <TotallyConfused@discussions.microsoft.com> wrote in 
> message news:43F28153-8132-4903-A2FF-7C1EB65C7571@microsoft.com...
> > Thank you.  Yes the forms name should be the same - fixed that.  But it is
> > still prompting me for Contactperson.  What is wrong?
> [...]
> >> >
> >> > DoCmd.RunSQL "UPDATE [Tracking] SET [Tracking].[Contactperson] = '" & _
> >> >            Forms![frm Provider Tracking].[Contactperson] & "' WHERE
> >> > ([Tracking].[ID])= " & _
> >> >            Forms![frmPRTrckg].[ID]
> 
> Check to make sure that "Contactperson" is actually the name of the field in 
> the Tracking table, and is spelled correctly.
> 
> -- 
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
> 
> (please reply to the newsgroup)
> 
0
Utf
1/11/2008 6:50:01 PM
Reply:

Similar Artilces:

SUMIFS help
Hi. Hope you’re able to help. I’m having difficulties the SUMIFS function. Either I’m using it incorrectly or perhaps it’s the wrong function for me! I’m trying to total the money amounts in column E as long as conditions in columns A (cell A6 in this example) and column H are True. However, I’m finding that the function is not totalling up the money amounts it should be totalling in column E. Instead, it’s just returning a single money amount in column E and ignoring the rest! This is the function as I’ve written it: =SUMIFS(BnkChqs!E3:E1000,BnkChqs!A3:A1000, A6,BnkChqs!...

newbie needs help
Hello, First to let you all know, I am a big novice at this kind of stuff, so please bear with me. What I am trying to do is make a trendchart with 9 different plots on it. How do I change the numbers on the side and bottom of the chart to read what I need them to? I take these tests 3 times a week and would like to chart all of them seperately and also together to chart progress for a whole month. One for each day, and then one for the month. Then I would like to do the same for the following months of the year. And I would like to have one chart to show the progress for the whole...

VBA Form Combo Box question.
Help !!! I know this is most likely a simple question, but I'm stuck :( I not to populate a Combo box in an Excel spread sheet I just enter the location in the ListFillRange (EmpData!A1:A100). But I got creative and tryed making a Userform with VBA. Now I'm lost :( In VBA the combo box doesn't have a ListFillRange.... One place I read to enter the location in the ControlSource field, but it doesn't take the information. It keeps giving me an error message. Can anyone Help Please? Thanks Wally See response in worksheetfunctions. -- HTH RP (remove nothere from t...

How do I create a database from an Excel form?
Hello Everybody - I need to see if Excel can be used to create a mailing list database from an Excel form. If so...how do I go about doing this? The list will need to include the name of the company, contact person, and address. Thanks in advance for all of your help! It is greatly appreciated! Here are a couple of links: http://www.mvps.org/dmcritchie/excel/mailmerg.htm http://www.mvps.org/word/FAQs/MailMerge The first is from David McRitchie and the second is by Beth Melton and Dave Rado. FIRESIGN98 wrote: > > Hello Everybody - > > I need to see if Excel can be used...

Formula help/suggestions?
I'm looking for help some help with a formula. How would I go about a formula for automatically adding 8 hours to a number each calendar month? I would like to open it and have it done for me if that's possible rather than having to remember to add it each month or forgetting if I did or not. For instance, i start out with the # 248 in a cell that I would like to automatically add 8 to each calendar month. "Gadgetman" <stoojz3@yahoo.com> wrote in message news:stoojz3-96EE83.15151022012011@usenet.ptd.net... > I'm looking for help some help with a formula....

Help! Unable to mount public folder store event 9519
Hi, I am getting the following error when tring to mount the public folder store. Event Type: Error Event Source: MSExchangeIS Event Category: General Event ID: 9519 Date: 11/01/2006 Time: 00:10:26 User: N/A Computer: SERVER Description: Error 0x8004010f starting database "First Storage Group\f7967383-856a-4b7f-9023-37c269a0e908" on the Microsoft Exchange Information Store. Look up of DB Info failed. For more information, click http://www.microsoft.com/contentredirect.asp. I have tried numerous ms kb articles to no avail. I did find this on a news group :- -------------...

I need help with a formula
Hi everyone I'm making a stock list sheet and I like to put on it the value - and + .. like when I take boxes out it will give me the total and when I add in it will change also. This is for a weekly count. I'm very new to excel so please H-E-L-P-. I need the instruction like u give it to a child. :) :) Thanks a lot -- pampam ------------------------------------------------------------------------ pampam's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26224 View this thread: http://www.excelforum.com/showthread.php?threadid=395241 We need ...

How can you set up a form that the cursor only moves to cells tha.
I have set up a form. Now I want my cusor to move through the worksheet only in certain cells. I want to be able to go from one cell that needs to be filled out to the next cell that needs to be filled out automatically. Example , move from cell a3 to c19 automatically. How can I do that? Hi! You can accomplish that by setting sheet protection. Select all the cells that you want to be able to navigate to then goto Format>Cells>Protection tab. Uncheck Locked. Now, goto Tools>Protection>Protect sheet. A list of options will appear. Uncheck Select locked cells and check...

Adding Contact information to a form
Hello - I am trying to get multiple contact entitys to display on a custom entity form. I have created a custom entity called 'Special Account information' It has a number of custom attributes that we do not wish to add directly to the account record. It is the child of the Account entity. I have made the Contact entity a referential child of 'Special Account Information' so it can have its own contacts, whether entered new or selected from the existing contacts in the system. I am working with the main application form. I am displaying all the custom attributes f...

formula help 02-10-10
Hi- Issue: 211 310 410 569 Would like to accomplish: 2211 2310 2410 2569 How do I add number 2 infront of the above ISSUE numbers as I have thousands of line to do. Soth If your number is in column A then in column B type =2 & A1 and copy it down. -- -John http://www.jmbundy.blogspot.com/ Please rate when your question is answered to help us and others know what is helpful. "Soth" wrote: > Hi- > > Issue: > 211 > 310 > 410 > 569 > > Would like to accomplish: > 2211 > 2310 > 2410 > 2...

Need Exchange limit help
I have a new SBS 2008 Server setup in a manufacturing environment. Two users within the company send and receive large CAD files. How do I allow this process? Right now one user is try to send a 185MB file and it is saying "the message being sent exceeds the message size established for this user." I have tried setting the limit in the console to 10GB and now I have unchecked the "enforce the mailbox quotas" box and he still can't send. If I go into the Exchange Management Console I still don't see how I can make this work. Is this something that...

VBA code to default item lookup by description
What is the code needed to add an item lookup that will default the sort by description and start the description lookup with what was entered in the item number field on the Sales Transaction window. Thank you, Amy ...

File Transfer using vb.net code
Hi, I would like to transfer/move a file from one folder to other folder in shareopint site. That needs to be done using vb.net. Could you please prove the code for that? Regards, Balu Submitted via EggHeadCafe - Software Developer Portal of Choice Dr. Dotnetsky's Cool .NET Tips and Tricks # 16 http://www.eggheadcafe.com/tutorials/aspnet/960bc693-889f-46c1-9b0e-1b0a67d13ea5/dr-dotnetskys-cool-net.aspx So your asking someone on this list to do your work for you? For free? Sounds like you might want to get some consulting time. -- Daniel A. Galant Imagine what w...

Help with Hurricane Database
I work at the Corporate office of a fast food chain. We have almost 1000 stores in 10 states - mostly in the South. We have many stores in the hurricane zones. During Rita and Katrina we decided we needed a better way to track how our stores are affected and what help we could provide. I've designed a database to do this. I have three main tables: tblHurricane Info: fldHurricaneYear fldHurricaneName tblUnitInfo: fldUnit - the unit number assigned to the store fldAddress fldCity fldState fldZip fldPhone fldDO fldMgr tblUnitForm fldAutoNumber fldUnit fldHurricaneName fldPr...

Outlook Certification Help
Do you need additional proof that you are an Outlook genius? Would you enjoy the respect and additional income that could come from being able to help everyone in your office on Microsoft Outlook? Get your Outlook Specialist certification and realize the benefits it can have. "Are You Certifiable (In Outlook, At Least)" is available at http://www.linkemup.us/areyoucertifiable.htm for only $18. It will go through each subject on the test and help you to prepare for this certification. If you do not plan to get certified but need a little extra help on using Outlook it is an excell...

AfterUpdate Form Event Fires Repeatedly
I've been having this problem for a few months with a db I'm working on. I know there must be something simple I'm overlooking, so I'd greatly appreciate any help in identifying what the problem is. I'm using the following to create a timestamp: Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName Me.dbLastUpdate = Now() frmuserInfoHIDDEN refers to a form that is hidden on startup that stores the name the user logged in with. This feature works fine. The AfterUpdate timestamp used to work as well. However, now it repeatedly fires and forces the user to stay on ...

Looking for help...I can't send e-mail using CRM web client
I'm having a problem with trying to send e-mails vie the CRM web client. When I try to send the e-mail I get a pop-up with the message in bold "Unexpected Error" "An error has occurred. For more information, contact your system administrator". I've checked the event logs, no errors are showing up in either my CRM server or my exchange server. I'm lost, new to CRM. Any help or ideas is appreciated. Thanks, You could try to add pre-windows2000 account to the administrator group on the exchange server. Some time that helps "Marty" wrote:...

Font format of rich edit ctrl in dialogs, Help!
Hi, I have used a lot of rich edit ctrl in my dialogs (I am sorry that I haven't use edit ctrl instead) and I found one problem now. The text displayed initially in the ctrl (set by DoDataExchange()) has different font format with the text which users type in later. Any experienced people can tell me the functions to make these two font same? Otherwise I think I will have to change about 100 rich edit ctrl to edit ctrl besides a lot of codes. Thank you a lot. -- Best regards, Kelvin ...

adding more code to an existing macro
Many thanks to those who helped me last week with my question of assigning macro to checkboxes. I now have a new related question. I am trying to add some new commands to the undo portion of my checkbox macro and just tried to copy in the new code next to what I already had, but I keep getting error messages. This is the code for the new actions: Range("G15").Select Selection.ClearContents Range("I15").Select Selection.ClearContents Range("C15").Select ActiveCell.FormulaR1C1 = "=RC[4]*RC[6]" Range("D15").Select When ...

Help in Query with two condition
hello all, I have a table like this: Planner Qty User6 CUT SUB BAM-06 1 CONC Yes No BAM-06 1 CONC No Yes BAM-06 1 TOC Yes No BAM-06 1 TOC No Yes BAM-06 1 TACT Yes No BAM-06 1 TACT No Yes JAXM-06 1 CONC Yes No JAXM-06 1 CONC No Yes JAXM-06 1 TOC Yes No JAXM-06 1 TOC No Yes JAXM-06 1 TACT Yes No JAXM-06 1 TACT No Yes Note: CUT and SUB are check box I want a result as follow: User6 A B C D E F CONC 2 2 1 1 1 1 TACT 2 2 1 1 1 1 TOC 2 2 1 1 1 1 WHERE: A SUM Qty =BAM-06 B SUM Qty =JAXM-06 C SUM Qty =BAM-06 if Cut=YES D SUM Qty =JAXM-06 if Cut=YES E SUM Qty =BAM-06 if SUB=YES F SUM Qty =JAXM-06 i...

Help with Date format
I want to enter dates into a worksheet like this: January 25, 2001 And i want to get excel to display the date with the following format: 1/25/01 I have tried using a date format from the format menu but it wont display the date like i want! It will only display the date as I typed it in. Thanks to anyone who can help. :) It appears you're typing the date into a cell formatted as something other than General. 1. Delete the current contents of the cell. 2. Format > Cell > Number tab. Choose a date format. 3. Now key in the date into the cell. HTH Jason Atlanta, GA >-----Or...

Excel File Rename Macro Help!
Hello All! Daily csv files are dumped into a shared folder and i have written a macro that goes into that folder and automatically pull in data to put it in microsoft access tables. What i want to do next is after importing the data into access, rename those files to include dates and times. This import runs every morning so whenever a new csv is dumped in there, my macro will run the newest ones and avoid the past ones. Any ideas guys? I guess im looking for a rename macro sql script. Please see below script. Any help would be greatly appreciated!! Dim fso As Object, fol As Object, fils...

A little macro help?
I would like to use a macro to copy and repeat lines 'X' times on a new page. To find out how many times each row is to be copied, the number is provided in the last column ('C' in this case) of a spreadsheet. Sample data for start point: Lastname First Name Qty Smith John 3 Hank Aaron 5 Result required on new sheet in same spreadsheet: Lastname First Name Smith John Smith John Smith John Hank Aaron Hank Aaron Hank Aaron Hank Aaron Hank Aaron Can someone provide some macro code that will create the number of required rows on a new sheet called 'list' within th...

Would anybody help me to recover the "Exception List Rule" on O2000?
I have removed it and I don't know how to recover it. Thank you. Have you enabled the Junk Mail Rule "Javier Hernando" <jhernand@hbas.osakidetza.net> wrote in message news:%23eCyBia2DHA.208@TK2MSFTNGP12.phx.gbl... > I have removed it and I don't know how to recover it. > > Thank you. > > ...

Need Help Please
I have a subform that when you double click on the lastname it brings up another subform. This works fine, however when I double click on the lastname a parameter box appears requesting that the lastname is typed in, then press okay. Below is the code that I am using to accomplish this. How do I get rid of the parameter box? Private Sub LastName_DblClick(Cancel As Integer) Dim stDocName As String Dim stLinkCriteria As String stLinkCriteria = Me.LastName stDocName = "frmHours_Worked subform" DoCmd.OpenForm stDocName, , , "LastName = " & stLinkCriteria Debug.Pri...