Checking License Keys against number available.

A

Aidan

Hello

I am setting up a database to record all the assets in my company. Each
record will show the user, OS Office version etc. I want to add field showing
the Product keys for the various programs. The product keys will be in a
different table and it will show the number of licenses available. Is there a
way of automatically checking the number of times the key has been used in
the Asset table and flaging this with a pop up?

Any help would be great!!

Cheers
Aidan
 
B

Brian

If the product key will show up once in a ProductKeys table as the primary
key and multiple times in the Assets table (i.e. once for each user where it
has been used), then you can use a domain aggregate functiont to show a
DCount of the current ProductKey in the Assets table.

Assuming you are using a form to assign keys to users, then simply run the
query after you pick the product.

ProductKey_AfterUpdate()
MsgBox DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
End Sub

This will pop up a count of how many times that key has been used as soon as
you pick the key on the form (presumably using a bound combo box).

You could add an If...Then Loop to check the DCount result against some
other figure (e.g. a field called MaxLicenses in your ProductKeys table that
indicates the maximum concurrent installations of that product key.

If you need to keep track of how many times the key has been used,
regardless of subsequent uninstallations, you really need a running total of
the number of times that key has been assigned, not how many current
assignments exist. To do this, use a form to assign keys to users, and run a
query from the Form_AfterUpdate that increments the usage count by one.
 
A

Aidan

Hi Brian

Just tried the first part and that works a treat!! I will try the rest
later.
Just a quick one how do I add my own text to the box that pops up? Something
along the lines of "This license has been used X times. Please check the
number of license's avvailable."

Thanks again
Aidan

Brian said:
If the product key will show up once in a ProductKeys table as the primary
key and multiple times in the Assets table (i.e. once for each user where it
has been used), then you can use a domain aggregate functiont to show a
DCount of the current ProductKey in the Assets table.

Assuming you are using a form to assign keys to users, then simply run the
query after you pick the product.

ProductKey_AfterUpdate()
MsgBox DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
End Sub

This will pop up a count of how many times that key has been used as soon as
you pick the key on the form (presumably using a bound combo box).

You could add an If...Then Loop to check the DCount result against some
other figure (e.g. a field called MaxLicenses in your ProductKeys table that
indicates the maximum concurrent installations of that product key.

If you need to keep track of how many times the key has been used,
regardless of subsequent uninstallations, you really need a running total of
the number of times that key has been assigned, not how many current
assignments exist. To do this, use a form to assign keys to users, and run a
query from the Form_AfterUpdate that increments the usage count by one.

Aidan said:
Hello

I am setting up a database to record all the assets in my company. Each
record will show the user, OS Office version etc. I want to add field showing
the Product keys for the various programs. The product keys will be in a
different table and it will show the number of licenses available. Is there a
way of automatically checking the number of times the key has been used in
the Asset table and flaging this with a pop up?

Any help would be great!!

Cheers
Aidan
 
B

Brian

To make the MsgBox easier to construct, do the DCount first and set a
variable, then reference that variable in your MsgBox:

Dim ProductCount as Integer
ProductCount = DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
MsgBox "This license has been used " & ProductCount & " times. Please check
the
number of licenses available."

You might as well set a second variable and tell the user how many licenses
are available in the same message. You would just need to have some record of
the total number available (let's call that MaxCount) and then find it (using
DLookup) and subtract it in your MsgBox like this:

MsgBox "This license has been used " & ProductCount & " times. There are " &
MaxCount - ProductCount & " licenses available."

Aidan said:
Hi Brian

Just tried the first part and that works a treat!! I will try the rest
later.
Just a quick one how do I add my own text to the box that pops up? Something
along the lines of "This license has been used X times. Please check the
number of license's avvailable."

Thanks again
Aidan

Brian said:
If the product key will show up once in a ProductKeys table as the primary
key and multiple times in the Assets table (i.e. once for each user where it
has been used), then you can use a domain aggregate functiont to show a
DCount of the current ProductKey in the Assets table.

Assuming you are using a form to assign keys to users, then simply run the
query after you pick the product.

ProductKey_AfterUpdate()
MsgBox DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
End Sub

This will pop up a count of how many times that key has been used as soon as
you pick the key on the form (presumably using a bound combo box).

You could add an If...Then Loop to check the DCount result against some
other figure (e.g. a field called MaxLicenses in your ProductKeys table that
indicates the maximum concurrent installations of that product key.

If you need to keep track of how many times the key has been used,
regardless of subsequent uninstallations, you really need a running total of
the number of times that key has been assigned, not how many current
assignments exist. To do this, use a form to assign keys to users, and run a
query from the Form_AfterUpdate that increments the usage count by one.

Aidan said:
Hello

I am setting up a database to record all the assets in my company. Each
record will show the user, OS Office version etc. I want to add field showing
the Product keys for the various programs. The product keys will be in a
different table and it will show the number of licenses available. Is there a
way of automatically checking the number of times the key has been used in
the Asset table and flaging this with a pop up?

Any help would be great!!

Cheers
Aidan
 
A

Aidan

Thanks!!!

Brian said:
To make the MsgBox easier to construct, do the DCount first and set a
variable, then reference that variable in your MsgBox:

Dim ProductCount as Integer
ProductCount = DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
MsgBox "This license has been used " & ProductCount & " times. Please check
the
number of licenses available."

You might as well set a second variable and tell the user how many licenses
are available in the same message. You would just need to have some record of
the total number available (let's call that MaxCount) and then find it (using
DLookup) and subtract it in your MsgBox like this:

MsgBox "This license has been used " & ProductCount & " times. There are " &
MaxCount - ProductCount & " licenses available."

Aidan said:
Hi Brian

Just tried the first part and that works a treat!! I will try the rest
later.
Just a quick one how do I add my own text to the box that pops up? Something
along the lines of "This license has been used X times. Please check the
number of license's avvailable."

Thanks again
Aidan

Brian said:
If the product key will show up once in a ProductKeys table as the primary
key and multiple times in the Assets table (i.e. once for each user where it
has been used), then you can use a domain aggregate functiont to show a
DCount of the current ProductKey in the Assets table.

Assuming you are using a form to assign keys to users, then simply run the
query after you pick the product.

ProductKey_AfterUpdate()
MsgBox DCount("[ProductKey","[Assets]","[ProductKey] = '" &
[Forms]![YourCurrentForm]![ProductKey] & "'")
End Sub

This will pop up a count of how many times that key has been used as soon as
you pick the key on the form (presumably using a bound combo box).

You could add an If...Then Loop to check the DCount result against some
other figure (e.g. a field called MaxLicenses in your ProductKeys table that
indicates the maximum concurrent installations of that product key.

If you need to keep track of how many times the key has been used,
regardless of subsequent uninstallations, you really need a running total of
the number of times that key has been assigned, not how many current
assignments exist. To do this, use a form to assign keys to users, and run a
query from the Form_AfterUpdate that increments the usage count by one.

:

Hello

I am setting up a database to record all the assets in my company. Each
record will show the user, OS Office version etc. I want to add field showing
the Product keys for the various programs. The product keys will be in a
different table and it will show the number of licenses available. Is there a
way of automatically checking the number of times the key has been used in
the Asset table and flaging this with a pop up?

Any help would be great!!

Cheers
Aidan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top