From: sharsy on
Hey Martin,

The [MemberID] field is not an autonumber - it is a number field with
no duplicates allowed. The [Reason] field is a text field, but it is a
drop-down with options retrieved from another table called
tblCRMReasons. MemberID is bound control to the table too.

I've added the code to the frmMembers object in the VBA Editor,
however I'm not sure if I've done it correctly as it has come up with
a "Run-time error 3134, Syntax error in INSERT INTO statement" , the
debugger highlights this part "DoCmd.RunSQL strSQL" after the 30 Day
insert bit (so the 1st one).

What do you reckon? :) Shari
From: Don Leverton on
Hi Shari,
Not to "nit-pick" ... but I'd recommend naming subforms with an "sbf" prefix
rather than a "frm". ;-)
As you get deeper into writing VBA code, you'll appreciate the use of
naming conventions to help make things clear.

Now, as far as a Main form / subform approach goes ... if you are using
"MemberID" as both the LinkMaster and LinkChild, and have Referential
Integrity set up at the table relationships level , you should be able to
select or enter the MemberID in the main form, and then enter the related
data directly into the subform.
Access will automatically fill in the MemberID into the subform as soon as
you type something into one of your other fields.

HTH,
Don

"sharsy" <sharibroughton(a)gmail.com> wrote in message
news:5304ea26-7e89-4120-b422-bcb953ee4365(a)g21g2000prn.googlegroups.com...
> Hello Martin,
>
> I am indifferent about my table names - though I can see from a VBA
> point of view they are somewhat lacking, so I have taken your advise
> and renamed my tables and forms - the structure of my setup is now as
> follows:
>
> tblMembers = Parent table
> tblCRM = Child table
>
> frmMembers = Parent form
> frmCRM = Child subform
>
> The [MemberID] field is the the linked field between them. A member
> can have many calls on the CRMDatabase, with the calls on the
> CRMDatabase being allocated to the unique MemberID on the Members
> table.
>
> Will this help?
>
> Shari :)