D
Dave
I have a form that I create/edit orders on. I also have a form that I
create/edit vendors on.
On the orders form there is a drop down list of vendors to assign to the
order. There is also a button I can click to open the vendor form. If there
is already a vendor assigned to the order (i.e. there is one selected in the
drop down box), the vendor form opens with this record for editing. If
there is no vendor assigned, I want the vendor form to open with a blank
record so a new vendor can be created.
What I cannot figure out is how to get the venndor form to open with a blank
record.
Here is the guts of my current code behind the button click event...
stDocName = "vendor"
If Len(Me![cboVendorID]) > 0 Then
stLinkCriteria = "[vendorid]=" & Me![cboVendorID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm stDocName
End If
It is the "else" code that is the problem. As written it opens the vendor
form with _all_ vendor records positioned on the first record. I want it to
open on a blank record and not include any other vendor records.
Can somone tell if this is possible and if so how I can do it?
Thanks
Dave
PS this is an Access 2000 file format ADP project pointing to a SQL Server
2000 database.
create/edit vendors on.
On the orders form there is a drop down list of vendors to assign to the
order. There is also a button I can click to open the vendor form. If there
is already a vendor assigned to the order (i.e. there is one selected in the
drop down box), the vendor form opens with this record for editing. If
there is no vendor assigned, I want the vendor form to open with a blank
record so a new vendor can be created.
What I cannot figure out is how to get the venndor form to open with a blank
record.
Here is the guts of my current code behind the button click event...
stDocName = "vendor"
If Len(Me![cboVendorID]) > 0 Then
stLinkCriteria = "[vendorid]=" & Me![cboVendorID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm stDocName
End If
It is the "else" code that is the problem. As written it opens the vendor
form with _all_ vendor records positioned on the first record. I want it to
open on a blank record and not include any other vendor records.
Can somone tell if this is possible and if so how I can do it?
Thanks
Dave
PS this is an Access 2000 file format ADP project pointing to a SQL Server
2000 database.