By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

if ticket is used

P: n/a
my ticketlog table as below

salesperson beginno endno
name1 201 250
name2 251 300

When I used ticket 288 on my sale form I should not let second record
to be deleted
on ticketlog form.
Sorry I have been on it for a long time before asking.
Any help ? Thank you in advance.

Jun 12 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Jun 12, 4:41 pm, "rum...@hotmail.com" <rum...@hotmail.comwrote:
my ticketlog table as below

salesperson beginno endno
name1 201 250
name2 251 300

When I used ticket 288 on my sale form I should not let second record
to be deleted
on ticketlog form.
Sorry I have been on it for a long time before asking.
Any help ? Thank you in advance.
HUH?

Jun 12 '07 #2

P: n/a
HUH?

Beg your pardon ?

Jun 13 '07 #3

P: n/a
On Jun 13, 6:22 am, "rum...@hotmail.com" <rum...@hotmail.comwrote:
HUH?

Beg your pardon ?
Exactly...

Jun 13 '07 #4

P: n/a
Thank you anyway spending your time.
If only I knew what is wrong with my request or posting.

Jun 13 '07 #5

P: n/a
ru****@hotmail.com wrote:
Thank you anyway spending your time.
If only I knew what is wrong with my request or posting.
Sorry, Rumkus, but we don't understand what it is you're saying. I
think your english is the issue, unfortunately. 8(

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Jun 13 '07 #6

P: n/a
rkc
ru****@hotmail.com wrote:
Thank you anyway spending your time.
If only I knew what is wrong with my request or posting.
[original question]
my ticketlog table as below

salesperson beginno endno
name1 201 250
name2 251 300

When I used ticket 288 on my sale form I should not let second record
to be deleted
on ticketlog form.
Sorry I have been on it for a long time before asking.
Any help ? Thank you in advance.
[/original question]

There isn't enough information to understand the question.

Do you also have a Sales table that indicates which ticket
numbers have been sold?

Is the TicketLog table an indication of tickets that have been
given to a sales person to sell?

My wild guess is that you don't want a tablelog record to be deleted
if a ticket in the series has been sold.

I also think the situation is probably modeled incorrectly.
Jun 13 '07 #7

P: n/a
My wild guess is that you don't want a tablelog record to be deleted
if a ticket in the series has been sold.
Spot on !

Among severals I have this ticketlog table and sale table.
All ticketbooks are logged to ticketlog table via a form surely.
and I want to know if any ticket number has been used on sales before
deleting a ticket log.

Temporarily I loop through sales within ticketlog and put a flag to a
dummy field on ticketlog table and
check it before updating any records on ticketlog table opening
ticketlog form each time.
Which means ages obviously.Couldn't think of any other way.

Any suggestion rather than this funny looping. Thank you


Jun 13 '07 #8

P: n/a
rkc
ru****@hotmail.com wrote:
>My wild guess is that you don't want a tablelog record to be deleted
if a ticket in the series has been sold.

Spot on !

Among severals I have this ticketlog table and sale table.
All ticketbooks are logged to ticketlog table via a form surely.
and I want to know if any ticket number has been used on sales before
deleting a ticket log.

Temporarily I loop through sales within ticketlog and put a flag to a
dummy field on ticketlog table and
check it before updating any records on ticketlog table opening
ticketlog form each time.
Which means ages obviously.Couldn't think of any other way.

Any suggestion rather than this funny looping. Thank you
Unless you want to re-think the tables involved there is no way to
get the database engine (which I assume is Jet/Access) to enforce
that rule.

There is no need to open and loop through the form though, if that
is what you're doing. You can code a function in VBA to check whether
you have a record in ticketlog that encompasses a ticket number.

Probably just use BETWEEN beginno and endno in an query.

I do not have enough information to even begin to suggest a better data
model so unless you want to give explaining what you're modeling a shot
that's about all I have for you.
Jun 13 '07 #9

P: n/a
Probably just use BETWEEN beginno and endno in an query.
That has done the job ! Thank you very much.
I now run a sql with between beginno and endno of the log record.
No looping or doing anything opening the log form.
Just checking record count of recordset before deleting or changing a
record on log table.

Thank you very much again for giving me back lighting speed.

Kind regards

Jun 14 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.