form opens at blank or at last edited

androomc

Registered User.
Local time
Today, 14:57
Joined
Jun 27, 2003
Messages
23
i have a slight problem with my customers form.

if customer details have been entered, and they need to be changed or 're-chosen' for some reason, i'd like the customers form to open at the last entered info. otherwise i'd like it to open at a blank page. is this possible? right now it's opening as a blank page. obviously i'd need some kind of condition but im unsure.

so far i have...

Private Sub Form_Load()
If Forms![SALES].[customer_ID] = "0" Then
DoCmd.GoToRecord , , acNewRec
Else
DoCmd.GoToRecord , , acGoTo, Me.customer_ID = pubcusID 'Buggy
End If

im not sure what that buggy line should read but basically i need to open the record with customer_ID equal to the public variable pubcusID.

as always, your help much appreciated.

p.s. now that i look at it, should the condition be changed to...

If IsNull ([forms![sales].[customer_ID] then

(im not even sure if this is valid syntax for that function.
 
you could just make the form a data entry form to get it blank whenever you open in

and use macros to open the form and go to last record

or possibly throw in command buttons for each situation you might want to do and link them to near identical forms (some based on query and some on just the table)

i dont know any VB, so i take shortcuts as much as i can
 
yeah i see your reasoning. usually i'd go down that road, but i'd much rather do it in VB and have just one form for each function, its bad enough keeping track of them all just now, without near identical ones.

thanks for the input.
andy.
 

Users who are viewing this thread

Back
Top Bottom