forms adding records

N

NewKidontheBlock

Hi!

I'm in the process of building a customer service type of database.

On it there are two forms, say frmMain and frmReview. frmReview is a subform
of frmMain and is related to it by an AutoNumber field. Referential Integrity
is enforced. Incidentally, I've tried solving withis problem with RI off as
well as on.

frmMain contains basic customer information - name, adress, telephone etc.

frmReview contains information about the customer gleaned at various
interviews.

When using the database, the user will enter frmMain and then go into
frmReview by clicking a button at the bottom of the form. frmReview is
extensive and is on something like 20 tabs.

Before the tabbed area there is a section which shows basic information
about the client just to reassure the user they are still using the correct
record.

frmReview doesn't have any navigation buttons. I've provided customised ones
to provide a more user friendly feel.

My problem (bet you thought it was never coming) is twofold.

The First, Last, Next and Previous buttons work fine. The Add a New Review
button, however, does not.

Firstly, it doesn't populate the top row of the form with the customer's
basic details and, secondly, after inputting all the review information it
doesn't add the record.

The button's coding is as follows :

Private Sub btnAddNewReview_Click()
On Error GoTo Err_btnAddNewReview_Click
DoCmd.GoToRecord , , acNewRec
Exit_btnAddNewReview_Click:
Exit Sub
Err_btnAddNewReview_Click:
MsgBox Err.Description
Resume Exit_btnAddNewReview_Click
End Sub

Any help would be greatly appreciated.

Kind regards

Tony
 
O

Ofer Cohen

I assume that the navigation buttons are located on the Main form, so to use
them you'll need to set the focus first to the sub form, and then run the
command to add record

Private Sub btnAddNewReview_Click()
On Error GoTo Err_btnAddNewReview_Click
Me.[Review sub form name].SetFocus
DoCmd.GoToRecord , , acNewRec
Exit_btnAddNewReview_Click:
Exit Sub
Err_btnAddNewReview_Click:
MsgBox Err.Description
Resume Exit_btnAddNewReview_Click
End Sub
 
N

NewKidontheBlock

Ofer

Thanks for your prompt reply. I'm hoping that a picture really does paint a
thousand words. You can view the two forms by logging on to
www.photobox.co.uk/album/3317641.

In the bottom right of the main form there is a button called 'Review
Notes'. When the user clicks this the review form is loaded and the latest
review record is displayed. (I've only shown the relevant part of the form.)

What I want to achieve is that, when the user clicks on 'Add a Review' the
fields on the top row of the form are populated with the related data from
the main form (Name, Hospital Number etc). These are there for user
friendliness purposes only; they don't get entered into the review form.
Then, after the user has finished entering the data, the record is added to
the appropriate table.

Thank you for your time.

Kind regards

Tony


Ofer Cohen said:
I assume that the navigation buttons are located on the Main form, so to use
them you'll need to set the focus first to the sub form, and then run the
command to add record

Private Sub btnAddNewReview_Click()
On Error GoTo Err_btnAddNewReview_Click
Me.[Review sub form name].SetFocus
DoCmd.GoToRecord , , acNewRec
Exit_btnAddNewReview_Click:
Exit Sub
Err_btnAddNewReview_Click:
MsgBox Err.Description
Resume Exit_btnAddNewReview_Click
End Sub

--
Good Luck
BS"D


NewKidontheBlock said:
Hi!

I'm in the process of building a customer service type of database.

On it there are two forms, say frmMain and frmReview. frmReview is a subform
of frmMain and is related to it by an AutoNumber field. Referential Integrity
is enforced. Incidentally, I've tried solving withis problem with RI off as
well as on.

frmMain contains basic customer information - name, adress, telephone etc.

frmReview contains information about the customer gleaned at various
interviews.

When using the database, the user will enter frmMain and then go into
frmReview by clicking a button at the bottom of the form. frmReview is
extensive and is on something like 20 tabs.

Before the tabbed area there is a section which shows basic information
about the client just to reassure the user they are still using the correct
record.

frmReview doesn't have any navigation buttons. I've provided customised ones
to provide a more user friendly feel.

My problem (bet you thought it was never coming) is twofold.

The First, Last, Next and Previous buttons work fine. The Add a New Review
button, however, does not.

Firstly, it doesn't populate the top row of the form with the customer's
basic details and, secondly, after inputting all the review information it
doesn't add the record.

The button's coding is as follows :

Private Sub btnAddNewReview_Click()
On Error GoTo Err_btnAddNewReview_Click
DoCmd.GoToRecord , , acNewRec
Exit_btnAddNewReview_Click:
Exit Sub
Err_btnAddNewReview_Click:
MsgBox Err.Description
Resume Exit_btnAddNewReview_Click
End Sub

Any help would be greatly appreciated.

Kind regards

Tony
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
Top