M
Marc
Dear All,
In order a speed up the shipment samples I built a database in Access 2K.
Since all the products which have to reach countries outside the EU
(European Union) must have an attached proforma invoice, I should need a
counter which increase its number if a boolean field is false.
The main form DataEntry has several fields, three of them are comboboxes. At
the first time one select the [Continent] in the 1st combobox, afterwards in
the second combobox only the countries that belong to that continent are
shown (filtered), and so on ....
After updating the country, in the DataEntry form a boolean field, called EU
(European Union), is bounded to the [Country] combobox. If a country belongs
to EU the boolean field is picked (true), if not, it is not checked (false).
Now it comes the difficult task for me:
How and where can I insert the following VB code in the form, so that the
counter increases its number only if the boolean field is false (the country
doesn't belong to EU)
Private Sub Form_Current()
If EU = False Then
On Error Resume Next 'It should never occur, just to be sure...
Me!ProformaInvoiceN°.DefaultValue = Nz(DMax("[ProformaInvoiceN°]",
"tblDataEntry"), 3022) + 1
End If
End Sub
At the moment the routine is inserted to the Cuttent Form event, but in this
way with every new record the couter increase the number.
I should be very greatful if someone could help me.
Thanks in advance,
Marc
In order a speed up the shipment samples I built a database in Access 2K.
Since all the products which have to reach countries outside the EU
(European Union) must have an attached proforma invoice, I should need a
counter which increase its number if a boolean field is false.
The main form DataEntry has several fields, three of them are comboboxes. At
the first time one select the [Continent] in the 1st combobox, afterwards in
the second combobox only the countries that belong to that continent are
shown (filtered), and so on ....
After updating the country, in the DataEntry form a boolean field, called EU
(European Union), is bounded to the [Country] combobox. If a country belongs
to EU the boolean field is picked (true), if not, it is not checked (false).
Now it comes the difficult task for me:
How and where can I insert the following VB code in the form, so that the
counter increases its number only if the boolean field is false (the country
doesn't belong to EU)
Private Sub Form_Current()
If EU = False Then
On Error Resume Next 'It should never occur, just to be sure...
Me!ProformaInvoiceN°.DefaultValue = Nz(DMax("[ProformaInvoiceN°]",
"tblDataEntry"), 3022) + 1
End If
End Sub
At the moment the routine is inserted to the Cuttent Form event, but in this
way with every new record the couter increase the number.
I should be very greatful if someone could help me.
Thanks in advance,
Marc