New record form and View Record form

wrightyrx7

Registered User.
Local time
Today, 04:06
Joined
Sep 4, 2014
Messages
104
Hi all,

I am wondering if how i am doing things is the best way.

Basically i always have two forms:-
  • NewRecord - for when someone clicked to create a new record
  • ViewEditRecord - opens the record that is clicked in the Datasheet

I do this because the New Record generates the Created By and Created On fields when the user clicks save, but i dont want this updating when someone Edits a record an clicks save.

Also the View Edit form has a delete button to delete the record but the New form does not.

I also want some textboxes/comboboxes locked after the new record is created. So i lock these on the ViewEdit form.

The only problem is, duplication of work. Say i want to add a new field, i have to do this on both forms.

So i am just wondering if i am going about this the right way?

Thanks in advance
Chris
 
I wouldn't say that's wrong - how often do you think you will have to do design changes such as add a new field? In a fully deployed db that should be infrequent. However, I prefer to have one form using VBA code to manage its behavior depending on which button opens the form. I use OpenArgs to pass parameter to the form.
 
I wouldn't say that's wrong - how often do you think you will have to do design changes such as add a new field? In a fully deployed db that should be infrequent. However, I prefer to have one form using VBA code to manage its behavior depending on which button opens the form. I use OpenArgs to pass parameter to the form.

Hi June,

Thanks for your reply.

I am just testing something out now. I have put an invisible textbox on a signle form and on load i use the following

Code:
  If Me.NewRecord Then
    Call NewRecordActions
Else
    Call ExistingRecordActions
End If

The subroutines in the above determine what buttons an labels to show/hide.

Seems to be a good way to use one form only.
 
Sure, that's the standard method for differentiating between new and existing Records! Just put that in the Form_Current event and you should be set!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom