A2K format - BeforeUpdate Question

G'day ppl

Have a form which after the user has completed all data input can invoice 
job out.

I have a command button:

Private Sub InvoiceBtn_Click()
    Dim InvoiceResp As Integer
    InvoiceResp = MsgBox("Are you sure you want to mark this record for 
Invoicing ?????", vbYesNo)
    If InvoiceResp = vbYes Then
    Me.Invoice = 1
    Me.WeekNo = Me.DateDel
    Else
    DoCmd.CancelEvent
    End If
End Sub

What I would like to have happen is that before it updates Me.Invoice, it 
checks that the [PackStatus]=6 (6=Pack is Delivered).
So if the criteria doesn't match then display message prompt"Record cannot 
be Invoiced, Not Delivered off system yet!".

TIA

Mark.



0
NoodNutt
4/23/2007 12:11:36 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
402 Views

Similar Articles

[PageSpeed] 2

the CancelEvent action serves no purpose in your code. try

Private Sub InvoiceBtn_Click()

    If Not Me!PackStatus = 6 Then
        Msgbox "Record cannot be Invoiced, " _
            & "Not Delivered off system yet!"
    ElseIf MsgBox("Are you sure you want to " _
        & "mark this record for Invoicing ?????", _
        vbYesNo+vbDefaultButton2) = vbYes Then
            Me!Invoice = 1
            Me!WeekNo = Me!DateDel
    End If

End Sub

hth


"NoodNutt" <mclind1@bigpond.com> wrote in message
news:%23MRfMCahHHA.4600@TK2MSFTNGP05.phx.gbl...
> G'day ppl
>
> Have a form which after the user has completed all data input can invoice
> job out.
>
> I have a command button:
>
> Private Sub InvoiceBtn_Click()
>     Dim InvoiceResp As Integer
>     InvoiceResp = MsgBox("Are you sure you want to mark this record for
> Invoicing ?????", vbYesNo)
>     If InvoiceResp = vbYes Then
>     Me.Invoice = 1
>     Me.WeekNo = Me.DateDel
>     Else
>     DoCmd.CancelEvent
>     End If
> End Sub
>
> What I would like to have happen is that before it updates Me.Invoice, it
> checks that the [PackStatus]=6 (6=Pack is Delivered).
> So if the criteria doesn't match then display message prompt"Record cannot
> be Invoiced, Not Delivered off system yet!".
>
> TIA
>
> Mark.
>
>
>


0
tina
4/23/2007 1:36:40 PM
G'day Tina

Everyday is a school day for me.

Many thx

Mark. 


0
NoodNutt
4/27/2007 12:20:54 PM
you're welcome  :)


"NoodNutt" <mclind1@bigpond.com> wrote in message
news:%23QKfCaMiHHA.5048@TK2MSFTNGP03.phx.gbl...
> G'day Tina
>
> Everyday is a school day for me.
>
> Many thx
>
> Mark.
>
>


0
tina
4/28/2007 3:02:59 AM
Reply:

Similar Artilces:

Custom Number Formats
Gotta list: 0.25 0.75 1.00 0.50 Want these to appear as follows when typed into a cell (no matter which one is typed in), preferrable right-aligned: ..25 1.0 ..75 ..5 Is there a custom format that can be used for this? Thanks. _c #.0# -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Christina" <Christina@discussions.microsoft.com> wrote in message news:1AC86D6F-5353-49A0-BBD8-054FDA7709E5@microsoft.com... > Gotta list: > > 0.25 > 0.75 > 1.00 > 0.50 > > Want these to appear as follows when typed into a cell (no m...

RW
Have just recently upgraded customer from v7.5 to V9. They have specialised inventory item numbers that include dimensions but when they print their SOP sales invoices - they only require the first 6 digits printed. We achieved this a while ago by putting a format on the field (XXXXXX). Since the upgrade one user has experienced a printing problem as the full item number appears - we have now establised that it is only if the user uses a smartlist to select the invoice and drills back to the invoice to print. If they use the inquiry screen to select the invoice - all is ok. Anyone any i...

Conditioning Formatting Question
Dear All, Could anyone help me with the following question: I have a spreadsheet with a column of cells that are coloured (colored in purple whilst a project is incomplete but which are then coloure white again when the project is finished. I have another column i which the completion date is written (once it is finished). Is there way I can use conditional formatting to have the first column becom uncoloured conditional on the other cells? Thus, I want cell B1 to b white IFF cell D1 is not empty. I am using Excel 97 (for my sins). Any help very gratefully received! Many thanks! Wil ...

Time formatting
I'm familiar with subtracting start time from finish time to get elapsed time, and formatting the elapsed time as a time function, to include d:h:mm for elapsed times of more than 24 hours. But I don't seem to be able to work out a formating that will, e.g., report 30 hours for the elapsed time for a number 1.25 [days]. Will formatting do it, or do I have to write my own parsing function? Thanks, Fred Holmes Format it as [hh]:mm, this handles more than 24 hours. -- HTH RP (remove nothere from the email address if mailing direct) "Fred Holmes" <fsh@his.com> wr...

Julian Date Question (Another)
Thought I had a handle on it, but guess not. This is my code. Me.JulianExpirationDate = Format(DateAdd("yyyy", 5, Now()), "dd/mm/yyyy") ? me.JulianExpirationDate 08/02/2015 Me.JulianExpirationDate = Format(Me.JulianExpirationDate, "yy") & Format(DatePart("y", Me.JulianExpirationDate), "000") ? me.JulianExpirationDate 15214 Shouldn't it be "15039"? What is wrong? Am I missing the whole idea of Julian date. I realize there are many different methods to Julian date calculation, some of which include time...

How do I format text in an outlook Task ?
I have an Outlook task form with some script in it to put a date stamp etc into the body of the task. The problem is that I want to make the date stamp bold. Trolling thru the net, I found references to Item.HTMLBody - but I cant seem to get this to work for a TASK - only for an email item. i.e. Item.HTMLBody = "<HTML><b/>Date Stamp.</b><BODY> Other Text.</BODY></HTML>" works for an email but NOT for a task. Once my task is created I can however enter text manually and make it bold manually. Any help is much appreciated. ...

how do you format a cell to be in degrees
I want to find the cosine of an angle, but the computer doesn't know the value I am referencing is in the form of a degree. can anyone help me!! you have to change it to radians in your formula =cos(Val*pi()/180) "justin" wrote: > I want to find the cosine of an angle, but the computer doesn't know the > value I am referencing is in the form of a degree. > > can anyone help me!! This may help you: Insert a degree symbol Help You can easily insert a degree symbol in your Office documents. Most fonts that Microsoft Windows® users have installed inclu...

Can i use conditional formating on a cell when it contains a formula?
I am trying a "conditional formatting" on a cell that contains formula, but it didn't work. "If cell value is equal to 0 then font - white" This doesn't work, stays always. If i use this condition on a cell without formula it works just fine. Thank -- si ----------------------------------------------------------------------- sit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=262 View this thread: http://www.excelforum.com/showthread.php?threadid=26784 Hi are you sure your formula returns an exact zero?. Could you post the formul...

Saving Question
Why does Excel sometimes ask me if I want to save my spreadhseet even though I haven't made any changes? For example, I just brought it up, made no changes, did nothing, and when I close it out I'm asked if I want to save. Never understood that. Some functions are "volatile" and force a recalculation upon opening the workbook. These commands include TODAY(), NOW(), AREAS() and some others I can't think of right now. Once the workbook is recalced, Excel assumes that it has changed, even if you didn't really change anything. -- Cordially, Chip Pearson Microsoft...

Formatting .. is it possible to ....
format a range of cells like c6 through h6 with a fill color of green if the value in cell k6 is positive and with a fill color of red if it is negative? How would that be done? One way: Select C6:H6, with C6 active. Choose Format/Conditional Formatting... Set the dropdowns and inputboxes to read: CF1: Formula is =$K6>0 Format1: <pattern>/<green> CF2: Formula is =$K6<0 Format2: <pattern>/<red> In article <BVKFh.65924$1H5.60595@newsfe16.phx>, az-willie <sclause@npole.com> wrote: > format a range of cells like c6 t...

register number question
Hello, I have a till set as register 50. The user has made a sale and it appears on store ops but it has not filtered through to head quarters. Does the register number have an effect on this? Thanks This is a multi-part message in MIME format. ------=_NextPart_000_00FD_01C7CA35.35875ED0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: quoted-printable RR, Try running a z-out on that register. --=20 Jeff=20 Check Point Software =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3...

Comma format button decimals
I find myself annoyingly frequently clicking the comma style button and then the reduce decimals twice to get whole number with comma formatting. I'd like to either make a new button or get this one to can the decimals. ...

Visual Basic question
I have a crystal report (which is nothing but static text) that I wish to print every time a sales order is printed from Great Plains. What code should I put in VB that will print this crystal report every time a sales order report prints. If that is not possible, what code should I put on a custom button that will make this crystal report print? ...

Combo box formatting
Is there a way to make certain entries in a combo box bold or change the background color of those items? Thank you, QB "QB" <QB@discussions.microsoft.com> wrote in message news:EC0B760D-179E-4658-8F5A-AC0C11328DF6@microsoft.com... > Is there a way to make certain entries in a combo box bold or change the > background color of those items? You mean, in the list, when you drop it down? No, an Access combo box can't do that. You can highlight items, sort of, by basing the combo box on a query that builds the display text and includes asterisks o...

OOF formatting is lost
When my users edit their Out of office reply through OWA the formatting is lost. I.e they use the font arial with size 12, after they save the settings and then go back to the same page all the formatting is lost. Anyone have any ideas? ...

More Conditional Formatting #3
Hi I need to use one condition to judge whether or not a cell is 90-95% of target or 100-105% of target. The other two conditions will be used, so i need to get this into one condition. Any help would be great. Thanks KCi, Use "Formula is." =OR(AND(A2>=Target*90%, A2 <= Target*95%),AND(A2>=Target*100%, A2<=Target*105%)) -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "KCi" <KCi@discussions.microsoft.com> wrote in message news:5216D751-611A-4C11-8930-02A76DBAB0E9@microsoft.com... > Hi I...

Win98SE Format
I am about to format my OS drive after many years. Can anyone direct me to a document which will instruct me how to save favorites, address book, emails etc. I have most apps/drivers saved, but am bound to forget something! David David wrote: > I am about to format my OS drive after many years. Can anyone > direct me to a document which will instruct me how to save favorites, > address book, emails etc. > I have most apps/drivers saved, but am bound to forget something! > David FAVORITES Browse to C:\WINDOWS\Favorites, copy the folder and stash i...

Why Does Date Format Change on Chart
Hello, I'm using Excel 97 SR-2 on a Windows XP machine with the date format under Regional Settings set to dd/mm/yyyy. I have a simple line chart (on a chart sheet) drawing data (date on X-axis and data on Y-axis) from three different worksheets, and am experiencing a problem with the dates on it randomly changing format from dd/mm/yyyy to m/d/yyyy. This is despite the fact that the dates in the worksheets are in dd/mm/yyyy format, and I have formatted the chart X-axis in that format also. Interestingly, if I click from the chart to one of the worksheets then back to the chart, the dat...

Mail Format #2
I have been able to send rich text emails via outlook for some months. In the last few days any rich text email is either returned or delivered minus the attachment. Can anyone help me with this? Hamish ...

how do I open email attachments in xls format
I have Windows XP and can not open an attachment in xls format. What do I do? Erika If you have Excel on your computer, Excel will open it. If you do not have Excel on your computer...........Excel nor any Office Programs are included with Windows XP.......... If you just want to view or print the Excel file you can Download and install the Excel Viewer from.... http://office.microsoft.com/downloads/2000/xlviewer.aspx For info on ordering Office Programs see this website. http://www.microsoft.com/office/programs/default.asp to see the Office products and how to purchase. Note:you pr...

A2k and VISTA
Using A2K, I made an install cd for my database. The user pc is running VISTA, and the install worked (with some security questions) and the database performed as expected. The user wanted a couple of changes to the database, so I went back to my development pc (W2K), made the changes and made a new install cd. Then I went to the user VISTA pc, and in Control Panel, I uninstalled the database program. I then used the new cd and installed the new database program on the machine. When I ran the database from the shortcut, it was the OLD database that I had uninstalled. After trying ...

Formatting Cells in Excel 97
Hi Guys, Sorry if I sound real stupid but is there anyway that we can control the column formatting in Excel 97 like let's say column A = GENERAL(6), column B = GENERAL(4), column C = TEXT(18) etc? Appreciate any form of advice, thanks!! I replied in the programming group. Are you seeking a programming answer? It's usually best to only post to one group, and include the remark "Please tell me if I should ask this in another group." On Thu, 28 Aug 2003 00:56:47 -0700, "Daryl" <daryl.ho@tnt.com> wrote: >Hi Guys, > >Sorry if I sound real stupid b...

Formatting Notes
Is there a method of formatting notes. For example, a note that listed IDs or passwords where the Icon (first line) is "Password" and each the password/application pair is listed on a separate line. hagadit <anonymous@discussions.microsoft.com> wrote: > Is there a method of formatting notes. For example, a note that > listed IDs or passwords where the Icon (first line) is "Password" and > each the password/application pair is listed on a separate line. It works for me if I create a note whose first line is "Password", whose second line is empty...

Apply conditional formatting to cells formatted as percentages?
I have formatted a column to display numbers as percentages. I want 100% to display as bold, but can't seem to apply the conditional formatting to it. The formatting works fine with plain text. Select the cells, then: <Format> <Conditional Formatting> Click Cell Value Is Click Equal to Enter 1 Then, click on "Format", and choose whatever you wish. Then <OK> <OK> And you should be done! -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! ----...

Conditional Formatting across different worksheets 04-27-10
Hello everyone, I looked over the internet and in this forum, but I have not found a solution to my problem (perhaps I did not understand the solutions that were presented on the Internet). Anyway, this is the problem: I have two sheets, one that I use as a control (i.e. a back up) that I will call Sheet 2, while Sheet 1 is a duplicate of Sheet 2 that is sent out to different people for quarterly updates. I keep Sheet2 hidden in the workbook I send out for updates so that only Sheet1 is visible. What I want to do is make the cells in Sheet 1 automatically change color if they ...