dbTalk Databases Forums  

To Flag or Not To Flag? That is the question....

comp.databases.ms-access comp.databases.ms-access


Discuss To Flag or Not To Flag? That is the question.... in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
spima05
 
Posts: n/a

Default To Flag or Not To Flag? That is the question.... - 10-14-2008 , 04:13 PM






Hello

I am working on a database to track sales reps involved on a sale. I
would like to flag the sales rep that initiated the sale but read that
creating fields used to flag are not recommended. Can anyone provide a
suggestion of another way to track this information?

Below is how my db is structured (and thank you Roger from this news
group with all your help with creating this structure)

tblOrder
salesOrderID
salesAmount
customerName

tblOrderRep
salesOrderID
repID
flag (this is the field i was going to add to flag which rep
initiated the sale)

tblRep
repID
repName
tier
upline

Thank you in advance for your time and advice.
Matt

Reply With Quote
  #2  
Old   
Roger
 
Posts: n/a

Default Re: To Flag or Not To Flag? That is the question.... - 10-14-2008 , 04:44 PM






On Oct 14, 3:13*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:
Quote:
Hello

I am working on a database to track sales reps involved on a sale. I
would like to flag the sales rep that initiated the sale but read that
creating fields used to flag are not recommended. Can anyone provide a
suggestion of another way to track this information?

Below is how my db is structured (and thank you Roger from this news
group with all your help with creating this structure)

tblOrder
* *salesOrderID
* *salesAmount
* *customerName

tblOrderRep
* *salesOrderID
* *repID
* *flag (this is the field i was going to add to flag which rep
initiated the sale)

tblRep
* *repID
* *repName
* *tier
* *upline

Thank you in advance for your time and advice.
Matt
I use 'yes / no' fields (or true / false) all the time
what was the reason given to not use them


by the way, tblOrderRep is the current table to use... you just need a
form afterupdate event to make sure there is never more than one rep
per order that initiated the sale


Reply With Quote
  #3  
Old   
spima05
 
Posts: n/a

Default Re: To Flag or Not To Flag? That is the question.... - 10-14-2008 , 06:17 PM



On Oct 14, 5:44*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Oct 14, 3:13*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:





Hello

I am working on a database to track sales reps involved on a sale. I
would like to flag the sales rep that initiated the sale but read that
creating fields used to flag are not recommended. Can anyone provide a
suggestion of another way to track this information?

Below is how my db is structured (and thank you Roger from this news
group with all your help with creating this structure)

tblOrder
* *salesOrderID
* *salesAmount
* *customerName

tblOrderRep
* *salesOrderID
* *repID
* *flag (this is the field i was going to add to flag which rep
initiated the sale)

tblRep
* *repID
* *repName
* *tier
* *upline

Thank you in advance for your time and advice.
Matt

I use 'yes / no' fields (or true / false) all the time
what was the reason given to not use them

by the way, tblOrderRep is the current table to use... you just need a
form afterupdate event to make sure there is never more than one rep
per order that initiated the sale- Hide quoted text -

- Show quoted text -
Thank you Roger. The form after update event is a good idea. Is it as
simple as creating a query to count the number of yes flags to ensure
there is only one or do i need to know VB to create an event?

Thank you
Matt


Reply With Quote
  #4  
Old   
Roger
 
Posts: n/a

Default Re: To Flag or Not To Flag? That is the question.... - 10-14-2008 , 10:14 PM



On Oct 14, 5:17*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:
Quote:
On Oct 14, 5:44*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:





On Oct 14, 3:13*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:

Hello

I am working on a database to track sales reps involved on a sale. I
would like to flag the sales rep that initiated the sale but read that
creating fields used to flag are not recommended. Can anyone provide a
suggestion of another way to track this information?

Below is how my db is structured (and thank you Roger from this news
group with all your help with creating this structure)

tblOrder
* *salesOrderID
* *salesAmount
* *customerName

tblOrderRep
* *salesOrderID
* *repID
* *flag (this is the field i was going to add to flag which rep
initiated the sale)

tblRep
* *repID
* *repName
* *tier
* *upline

Thank you in advance for your time and advice.
Matt

I use 'yes / no' fields (or true / false) all the time
what was the reason given to not use them

by the way, tblOrderRep is the current table to use... you just need a
form afterupdate event to make sure there is never more than one rep
per order that initiated the sale- Hide quoted text -

- Show quoted text -

Thank you Roger. The form after update event is a good idea. Is it as
simple as creating a query to count the number of yes flags to ensure
there is only one or do i need to know VB to create an event?

Thank you
Matt- Hide quoted text -

- Show quoted text -
in the form's afterUpdate event you need this VBA

dim strWhere as string

strWhere = "salesOrderId = " & salesOrderId & " AND "
strWhere = strWhere & "repId = " & repId
if (dcount("salesOrderId", "tblOrderRep", strWhere) > 1) then
msgbox "More than one rep initiating this sales order"
end if


Reply With Quote
  #5  
Old   
spima05
 
Posts: n/a

Default Re: To Flag or Not To Flag? That is the question.... - 10-16-2008 , 09:41 PM



On Oct 14, 11:14*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Oct 14, 5:17*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:





On Oct 14, 5:44*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:

On Oct 14, 3:13*pm, spima05 <mspilot... (AT) gmail (DOT) com> wrote:

Hello

I am working on a database to track sales reps involved on a sale. I
would like to flag the sales rep that initiated the sale but read that
creating fields used to flag are not recommended. Can anyone provide a
suggestion of another way to track this information?

Below is how my db is structured (and thank you Roger from this news
group with all your help with creating this structure)

tblOrder
* *salesOrderID
* *salesAmount
* *customerName

tblOrderRep
* *salesOrderID
* *repID
* *flag (this is the field i was going to add to flag which rep
initiated the sale)

tblRep
* *repID
* *repName
* *tier
* *upline

Thank you in advance for your time and advice.
Matt

I use 'yes / no' fields (or true / false) all the time
what was the reason given to not use them

by the way, tblOrderRep is the current table to use... you just need a
form afterupdate event to make sure there is never more than one rep
per order that initiated the sale- Hide quoted text -

- Show quoted text -

Thank you Roger. The form after update event is a good idea. Is it as
simple as creating a query to count the number of yes flags to ensure
there is only one or do i need to know VB to create an event?

Thank you
Matt- Hide quoted text -

- Show quoted text -

in the form's afterUpdate event you need this VBA

dim strWhere as string

strWhere = "salesOrderId = " & salesOrderId & " AND "
strWhere = strWhere & *"repId = " & repId
if (dcount("salesOrderId", "tblOrderRep", strWhere) > 1) then
* * msgbox "More than one rep initiating this sales order"
end if- Hide quoted text -

- Show quoted text -
Hello Roger

Sorry for not replying sooner. Thank you for providing the After
Update code in your last posting. I tried entering the after update
code you provided on the subform containing the flag, on the field for
the Flag and the main form containing the form but i am not getting
the message in the code when i select more than one rep for the flag.

if you have time, please let me know if I am applying the code to the
wrong spot or if a change needs to be made to the code.

thank you for your help.
Matt


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.