Re: Creating a sequence number
- From: "Red via AccessMonster.com" <u15475@uwe>
- Date: Tue, 25 Apr 2006 07:55:37 GMT
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,[quoted text clipped - 58 lines]
I am working with your code and it is working ok except for a couple of
TC (MVP Access)
http://tc2.atspace.com
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200604/1
.
- Follow-Ups:
- Re: Creating a sequence number
- From: BruceM
- Re: Creating a sequence number
- References:
- Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: TC
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: BruceM
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: BruceM
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: TC
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: BruceM
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: BruceM
- Re: Creating a sequence number
- From: Red via AccessMonster.com
- Re: Creating a sequence number
- From: BruceM
- Creating a sequence number
- Prev by Date: Re: Limit characters in a text box
- Next by Date: Re: Update Forms into Table
- Previous by thread: Re: Creating a sequence number
- Next by thread: Re: Creating a sequence number
- Index(es):
Relevant Pages
|