Re: Creating a sequence number

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm sorry Bruce, I'll try and be more clear in my descriptions. as far as
the MsgBox code, I thought that was your thinking when you put the line of
code in was to test it. I'm at a very early stage of writing code and I will
use your practice to test code in this manner when I'm writing future code if
you dont mind. Now to my problem. What I have is a form that has patient
info ie Dr info, appt details, insurance details, personal information etc.
On the botton of the form I have two Cmd Buttons to create an invoice, one if
the invoice is being sent to the patient and the other if the invoice is
being sent to an insurance co (utilizing same table as Record Source for
either Invoice form). What I want to do is when I click either button, the
sequence number we have been talking about will populate. When I added the
code in the current event, nothing displays until I scroll forward. (I've
been thinking and will test it, but maybe I need to add this code to another
event? Perhaps "on click"? I'll do some experimenting). On the Insurance
Invoice the sequence number does display after scrolling forward, but on the
patient Invoice (like I said, same form except where to send bill having same
record source) the code errors. I hope I have explained this a bit better
this time. I do appreciate you help. in-turn, one day I hope to be good
enough to help others.

VR,

Red




BruceM wrote:
I added the message box line when I was testing the code, and forgot to
remove it. Sorry about that. Just remove the line:
MsgBox "varResult is null"
If you scroll forward from the most recently entered record you are moving
to a new record. That was why the message box line kicked in. If the field
in which the sequence number appears is set in table design view to
Indexed - No Duplicates you will not be able to move past the new record
unless the field is completed.
The code is designed for new records. Once the record has been created it
is no longer new, so the existing number will remain. Are you trying to
apply the code to existing records that do not contain a sequence number?
When you add the code to another form you need to adjust the field and table
names to match the new record source. But are you adding the same code
separately to records from different tables? Is the sequence number part of
relationships? Maybe you explained all of this earlier in the thread, but I
can't find it. Please explain briefly the database's purpose and structure.
I can't quite sort out all of your questions.

Hi Bruce,
I am working with your code and it is working ok except for a couple of
[quoted text clipped - 58 lines]
TC (MVP Access)
http://tc2.atspace.com

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



Relevant Pages

  • Re: Generate my own autonumber?
    ... similarly minimize the chance of an error event. ... but one which will maintain the sequence infallibly ... no gaps. ... invoice reference number. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Group cells and sort
    ... I understand your goal - each SKU on an order should remain in the ... sequence they where placed in, and that the FIRST item (presumbly defined ... So my next question is what determines the sort of the each order ... Sort on Invoice and Helper ...
    (microsoft.public.excel.programming)
  • Re: strange shopping cart number
    ... shopping card coding I'm working with, the way it works is to get the timein seconds like 1172693735 and that's the shopper_ID number and the shopping_cart_last_modified number is generated the same way once they check out... ... If two customers spend the exact same time shopping then yes, ... If only the first or second timestamp would be used as the id, then at least they'd be unique and in sequence. ... In fact the invoice number is only generated on the fly when composing a confirmation email and on the admin interface to the shopping carts. ...
    (comp.lang.php)
  • Re: How to generate unique document number ?
    ... Do not use the cache on a sequence. ... transaction, or an error may occur, causing the transaction to ... get missing numbers. ... Using the example of an invoice. ...
    (comp.databases.oracle.server)
  • Re: See all records entered
    ... form even though I know the invoice exists. ... "Gina Whipp" wrote: ... Tremors ... I am able to add a record, then add a new record and be able to scroll ...
    (microsoft.public.access.forms)