Next button problems

I have a next button in a form that I have criteria for.  I have a date field
that has to be entered before going to another record.  When I click the next
button I get the pop up that says click update to continue but the form
displays the next record instead of staying on the current record that needs
updating.  Here is the code that I am using.
____________________________________________________________________________________
Private Sub Command39_Click()
If IsNull([Post Called Customer]) Then
MsgBox "You must click the UPDATE button to continue!!!"
Cancel = True
End If

On Error GoTo Err_Command39_Click


    DoCmd.GoToRecord , , acNext

Exit_Command39_Click:
    Exit Sub

Err_Command39_Click:
    MsgBox Err.Description
    Resume Exit_Command39_Click
    
End Sub
________________________________________________________________________
Thank you for all your help!!!!!!!!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200704/1

0
spcscooter
4/13/2007 8:06:33 PM
access.forms 6864 articles. 2 followers. Follow

4 Replies
731 Views

Similar Articles

[PageSpeed] 50

Try this:

Private Sub Command39_Click()

On Error GoTo Err_Command39_Click

If IsNull([Post Called Customer]) Then
MsgBox "You must click the UPDATE button to continue!!!"
Cancel = True
Else
   DoCmd.GoToRecord , , acNext
End If

Exit_Command39_Click:
   Exit Sub

Err_Command39_Click:
   MsgBox Err.Description
   Resume Exit_Command39_Click
   
End Sub

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200704/1

0
missinglinq
4/13/2007 9:23:40 PM
There are so many ways a record can be saved.
You are testing only via the click of your button.

Move the test into the BeforeUpdate event of the form instead:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
        If IsNull([Post Called Customer]) Then
            MsgBox "You must enter the Post Called Customer."
            Cancel = True
        End If
    End Sub

In the Click event of your command button, use:
    RunCommand acCmdSaveRecord
    RunCommand acCmdNextRecord
along with the error handler part.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"spcscooter via AccessMonster.com" <u30679@uwe> wrote in message
news:70a816eca29ba@uwe...
>I have a next button in a form that I have criteria for.  I have a date 
>field
> that has to be entered before going to another record.  When I click the 
> next
> button I get the pop up that says click update to continue but the form
> displays the next record instead of staying on the current record that 
> needs
> updating.  Here is the code that I am using.
> ____________________________________________________________________________________
> Private Sub Command39_Click()
> If IsNull([Post Called Customer]) Then
> MsgBox "You must click the UPDATE button to continue!!!"
> Cancel = True
> End If
>
> On Error GoTo Err_Command39_Click
>
>
>    DoCmd.GoToRecord , , acNext
>
> Exit_Command39_Click:
>    Exit Sub
>
> Err_Command39_Click:
>    MsgBox Err.Description
>    Resume Exit_Command39_Click
>
> End Sub
> ________________________________________________________________________
> Thank you for all your help!!!!!!!! 

0
Allen
4/14/2007 4:11:18 AM
Thank you all very much.  You have no idea how much this helps!!!

missinglinq wrote:
>Try this:
>
>Private Sub Command39_Click()
>
>On Error GoTo Err_Command39_Click
>
>If IsNull([Post Called Customer]) Then
>MsgBox "You must click the UPDATE button to continue!!!"
>Cancel = True
>Else
>   DoCmd.GoToRecord , , acNext
>End If
>
>Exit_Command39_Click:
>   Exit Sub
>
>Err_Command39_Click:
>   MsgBox Err.Description
>   Resume Exit_Command39_Click
>   
>End Sub
>

-- 
Scot Rawlings
Technical Trainer
Comcast 
Auburn, WA

Message posted via http://www.accessmonster.com

0
spcscooter
4/14/2007 9:51:21 AM
Thank you all very much.  You have no idea how much this helps!!!

Allen Browne wrote:
>There are so many ways a record can be saved.
>You are testing only via the click of your button.
>
>Move the test into the BeforeUpdate event of the form instead:
>    Private Sub Form_BeforeUpdate(Cancel As Integer)
>        If IsNull([Post Called Customer]) Then
>            MsgBox "You must enter the Post Called Customer."
>            Cancel = True
>        End If
>    End Sub
>
>In the Click event of your command button, use:
>    RunCommand acCmdSaveRecord
>    RunCommand acCmdNextRecord
>along with the error handler part.
>
>>I have a next button in a form that I have criteria for.  I have a date 
>>field
>[quoted text clipped - 25 lines]
>> ________________________________________________________________________
>> Thank you for all your help!!!!!!!!

-- 
Scot Rawlings
Technical Trainer
Comcast 
Auburn, WA

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200704/1

0
spcscooter
4/14/2007 9:51:32 AM
Reply:

Similar Artilces:

Background problem
I would like to add a background to a Visio drawing. But whenever I try dragging a background (from the background stencil) to my drawing, the background appears in the *corner* of my diagram only. I think that this has to do with the orientation of the page. My drawing is portrait and the background appears to be landscape. I tried to copy-and-paste the background. This appears to work (the dragged background fits over my drawing perfectly) but then hides my drawing! And I can see how to bring my drawing to the foreground. Visio is a nice programe - with a bad interface and help system. ...

The problem with Moneydance
The problem with stuff like moneydance, is it's basically a hand full of people working on it. Support is hard to obtain, only via email. All imports I've done have been way, WAY off. Every Account needed massive tweaking. Documentation barely there. Entering transactions are a little confusing too. Quicken is really bloated. I have a few simple things to track 1. Credit cards 2. (2) checking accounts 3. Savings account 4. Wife's 403B 5. My 401k 6. (2) oppenheimer accounts. I don't really use budget planning reports, or anything like that. I run the monthly r...

problem creating report
I have 15 working forms from 2 diferant colums from one table what I want is to run each query on its own line of a report with 4 calculations at the end I can select 1 query and produce the first line but how do I move to second line and query? thanks Duane Hookom wrote: > This is a really unusual question. What do your forms and columns have to do > with your queries and report? > > A report can have only one record source. This record source could be a > union query. You can also use subreports to display additional queries. > thank you ...

Problems installing IM on server
We recently upgraded to Dynamics GP 9.0, when we tried to upgrade/install integration manager on the server, it refused to complete the install and rolled back the installation. However when we installed it on a client machine, the installation/upgrade went through without a hitch. Why am I having a problem loading it on the server? I've never loaded IM on the server. Only on workstations. The only thing that should be on the server for IM is the IM Database for shared access. "Leni" wrote: > We recently upgraded to Dynamics GP 9.0, when we tried to upgrade/install ...

Conditional Formatting Problem #7
Is there a way to make conditonal formatting work when there is a formula in the cell? Conditional foramtting works if there is no formula in the cell. If one sheet is linked to another that doesn't work either. Is there a way to get around this? Under conditonal formatting there is a conditon "formula is." What would you put in there to have the cell format they you would like? There are two different things: a) the cell, containing a cell formula, a value or nothing b) the condition, containing a boolean formula (formula is) - b) can refer to a), but a) referring to a...

Form Header Control problem
I have a form based on a query that displays fields in the form header and data is entered in the detail section. When I use the record selector to go through the records the data in the detail area is updated but not the header section. I added the header section so that I could insert a tab control at the top of the detail section. Thanks in advance for any input. ...

ActiveX Property Page OK button
I would like to know how can I trap ActiveX Property Page OK button event ? I want to do some checking of property controls before user clicks on activex property page OK button..please help. Thanx Ashish ...

Outlook 2003 Cached Mode problems
I have a client who successfully connects to an Exchange server using Outlook 2003 in Cached Mode. All with the exception of one is working fine. This particular user, all of a sudden is unable to connect. Symptoms started with new messages not appearing. With Cached Mode off all is fine but as the server is remote it is deadly slow. The OST has been deleted, the Profile has been created, Outlook has been repair, and even uninstalled and reinstalled, but always the same problem. The Calendar and the Contacts sync fine, then early on through the Inbox it stops. Nothing else syncs. I have...

Field text range problem
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC In my applescript, I need to find out if the user has put the cursor in a field at the time the script is run. <br> There is no inField function and I can't seem to get a (start of / end of) text range of a field relative to the start of the document, for each field when looping through all the fields. <br> I realize that text ranges contain fields. This makes it confusing that I am trying to find a text range or selection object that may be in a field. <br><br>Here is a little scr...

Problem with data using IF and Nested IF statements possibly???
Afternoon All I am attempting to analyse data from multiple worksheets from numerous people the incoming data all has one thing in common column A this is a certain frequency a job is done. The problem is that there are many ways of entering the data ie 12 months or 52 weeks or 365 days all essentially meaning the same thing. My idea is to collate the data in col A and then using the Helper column as the standard frequencies ie if cell A1 = 12 months, closes frequency in helper is 52 weeks therefore value in C1 = 52 weeks. By using an IF statement I can change the value of one frequen...

Option Buttons Group Box
I am constructing a questionaire with responses from 1 - 5. After using the "group box" tool to group the option buttons for a response to the second question, the response from the first set is eliminated. How do I keep the responses seperate for each set of questions? Also, how do I make the border for the group box disappear? First, did you use the optionbuttons from the Forms toolbar--not the controltoolbox toolbar? (it sounds like you may have mixed and matched your controls.) If you did use optionbuttons from the control toolbox toolbar, you can "group" them b...

Activities Follow-Up Problem
When I create a new phone call activity through the activities of a Lead, the Sender, Recipient and Phone Number fields are populated. However, when I create a phone call using the "Follow-Up" option from within the lead or another activity, that information does not come over . This is a real pain, because the beauty of the "Follow-Up" feature is that you don't have to go back to the activity list to add calls. Any Ideas why this happends ? Thanks Hi Carlos, I know that's the pain and I have seen that problem before at different clients. first I think t...

problem Opening jpg's only
Recently, in Outlook 2003, I noticed that I can';t open and view jpg's anymore. Other attachements (mpg, pdf) are fine. I get the message: 'The system cannot find the file specified' I can save the file to disk and can view it easily just by clicking on it. It happens whether McAfee antivirus is enabled or disabled. I don't think it is level 1 attachments which are being blocked as in Microsoft Knowledge Base Article - 829982. Any ideas would be appreciated. Thanks Craig I am having the same issue. Any suggestions would be helpful! Thanks Jeremy >-----Original M...

Outlook Express Mail Rules Problem
Hi, I'm using OE 6.0 on my home system and have a number of rules setup to either move incoming mail to specific folders or to delete it based on subject or message content. The delete rules are the last ones in the list. I've recently changes a couple of rules and now I find mail being deleted which should have been moved into a folder. The rules look okay. Is there a registry key or a file somewhere in the system which might be the problem? TIA Bernie -- bernie@ms-training.org.uk MS Training and Consultancy http://www.ms-training.org.uk Since Outlook Express is part o...

problem...
When I am sending an email with an attachment of size 11mb for instance, I can not cancel the transmission. When I try to open the concerning message in the outbox, outlook says you can not open the item, it is being transmitted... Nor can I delete it. I hate this problem and cant solve it. Please guide me. Running against Exchange server or with a local data file? -- Russ Valentine [MVP-Outlook] "exciter" <t24680@hotmail.com> wrote in message news:%23FeC9c8hGHA.3408@TK2MSFTNGP05.phx.gbl... > When I am sending an email with an attachment of size 11mb for instance, >...

Hyperlink problem to cell in same workbook
I have a hyperlink created by a VB program that should link to a cell on a different worksheet within the same book. The hyperlink code currently is as follows: =HYPERLINK(ADDRESS(4,2,1,FALSE,"MultipleAliases"),"MULTIPLE DP ALIASES") MultipleAliases is a separate worksheet and I want the link to jump to row 4 cell 2 on this sheet. I realise that normally you need a spreadsheet identifier as part of the worksheet definition, thus the "MultipleAliases" would be "[FILE1.XLS]MultipleAliases" if this was saved as FILE1.XLS. If I do save this file wi...

Jump to start of next row teaser
Hi, can anyone assist in telling me if there is either :- a) a shortcut key b) a macro c) none of the above but another solution to jumping to the beginning of a new row on pressing a key. For example, after completeing cell m10 can you press enter (or any other key) and the cursor will automatically go to cell a11, then after you get to m11 it jumps to a12 and so on? Just to make things a little trickier, I know you can do this using the protect worksheet etc function, but I also have the data filter running which doesn't work when the protect sheet function is on. If there is a macr...

Attached file problem
Outlook 2003 refuses to open an attachment sent to me with the name Confirmation.rtf giving out the message: "Cannot create file: Confirmation.rtf. Right click the folder you want to create the file in and then click Properties on the shortcut menu to check your permissions for the folder." However if the same file is sent with a different name (say confirm.rtf) then Outlook is quite happy to open it! I have hundreds of emails in my Sent Items folder each with an attachment called Confirmation.rtf - could this be the cause of the problem? Incidentally I can't open any of...

Email routing problem
Hello all, I would appreciate advices for the following scenario. I have three mail servers responsible for SMTP address spaces A, B, and C. Only server A is public. It is being used as a front-end SMTP router and also runs anti-spam and anti-virus. Servers B and C host mailboxes for two overlapping sets of users - I mean that some users have mailboxes on both servers and connect to either one depending on what computer they are using. Only server B is Exchange 2003; server C is just a third party IMAP server. Server A is Sendmail and runs on Linux. It is configured to forward all incoming em...

Merge Problems
I'm not sure if this question should be in word or excel forums, so let me know. I have created a spreadsheet that pulls data from an excel sheet to complete the merge in word. One of the cells that transfers over is a formula that calculates a score. I want the merge to show the number that's in the cell. The cells are formatted to show through one decimal space. When I merge over, it shows the entire number that excel calculates. I can't figure out if I need to change the excel cells, or the word merge document to just show the numbers through the first deci...

what's the problem with online quote server?
For the past month or two, it's unavailable most of the time. Money keeps telling me to check my internet connection, which is not the problem. I have tried updating prices online at different days of week and different times of day, but I think the success rate is less than 10%. ...

Macro Assigned to Tool Bar Button
How can I tell what Macro is assigned to a tool bar button? Thanks Right-Click the Toolbar and select Customize. Then Right-Click the button and select Assign Macro... "C" <C@discussions.microsoft.com> wrote in message news:7ADB30E4-7ADD-43B8-8696-53C97C9D4100@microsoft.com... > How can I tell what Macro is assigned to a tool bar button? > > Thanks Thanks Jim. That was fairly simple. "Jim Spiller" wrote: > Right-Click the Toolbar and select Customize. Then Right-Click the button > and select Assign Macro... > >...

Problems printing from Publisher
This is wierd. Any document I print fro Publisher to my Panasonic KX-P7100 laser printer gets enlarged by a factor of four or more - so it only prints out the top left hand corner (but enlarged). None of the other programs on the computer do this. I've installed all the updates and I've got the most updated drivers for the printer. Any suggestions? Maybe uninstalling and reinstalling the printer would help. Panasonic has an utility that will remove all the printer files. Starting fresh could be a solution, Publisher is more demanding on printer issues than most applications. ht...

scroll bar problem
When I left click and drag the horizontal or vertical scroll bars in Excel , nothing scrolls. All I get is a pop-up box that indicates a row or column # (and then movement after releasing the left mouse button). Scroll works fine on web pages. Any ideas? That's the normal Excel scrollbar dragging behavior up thorough Excel 2000. Starting with Excel 2002 the scrolling was real time. -- Jim Rech Excel MVP ...

Problem after MS Update KB978207
Hi All, After installing KB978207 we found we had no network connection and IPSec eventId: 7023. Has anyone else installed this yet or found a solution to this? Thanks, Nick My guess is this is that old DNS reserved ports issue that can happen randomly on any reboot and has nothing to do with KB978207. Make sure you add the DNS reservation patch to fix your IPSec booting issue: http://msmvps.com/blogs/bradley/archive/2009/03/11/sbs-2003-and-dns-patch-issues-revisited.aspx -- Allan Williams Nick wrote: > Hi All, > > After installing KB97820...