Add Form Control for autonumber

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having difficulting figuring this one out.

I have a form that has an autonumber with another subform that has an
autonumber. On the subform I want to put a form control with VBA so that the
user can only insert one record within that subform.

I am fairly new with VBA and not sure how to go about it.

Thank you.
 
lisedum said:
I am having difficulting figuring this one out.

I have a form that has an autonumber with another subform that has an
autonumber. On the subform I want to put a form control with VBA so that
the
user can only insert one record within that subform.

I am fairly new with VBA and not sure how to go about it.

Thank you.

I'm having difficulty with this one too since the whole point of having a
subform is to be able to handle a one-to-many relationship and hence have
multiple records. Do you really need the subform?

Regards,
Keith.
www.keithwilby.com
 
I have a similar situation where the main form is the many side and the sub
form is the one side. My subform is in Form view and has no navigation
buttons. Data Entry is set to No and Cycle is set to Current Record. It
take care of itself.
 
Klatuu said:
I have a similar situation where the main form is the many side and the sub
form is the one side. My subform is in Form view and has no navigation
buttons. Data Entry is set to No and Cycle is set to Current Record. It
take care of itself.

Hi Klatuu,

Can you elaborate on this for my benefit please? I must admit I'd never
contemplated a form/subform arrangement where the sub is on the "one" side
of the join and can't visualise how it would work. Can you give an example?

Many thanks,
Keith.
 
The situation is our data is grouped by Activity Number in almost all cases.
Each Activity Number has an associated Master Activity NUmber. One Master
can have one to Many Activities; however, Master Activity is used only in a
small percentage of reporting cases. Also, the users contentrate on Activity
Numbers and they are the focus for data entry. An Activity has 38 fields and
a Master has only 4.

So, my main for is based on the Activity Table. The sub form is based on
the Master Activity table. The subform control on the main form links the two
using the Master Activity number for both Master and Child. Then, as I
stated earlier, the subform has Data Entry set to No, Cycle set to Current
record, it has no navigation capabilites, or any way to move off the current
record.

Also, in many cases, the Master Activity and Activity numbers will be the
same, so when a new Activity record is added, my code populates the Master
Activity and Description fields of the sub form and leaves the two other
controls Null.

I have tried to find a way to fool it and add a second record, but have not,
so as far as I can tell, this is working for me.
 
Klatuu said:
The situation is our data is grouped by Activity Number in almost all
cases.
Each Activity Number has an associated Master Activity NUmber. One Master
can have one to Many Activities; however, Master Activity is used only in
a
small percentage of reporting cases. Also, the users contentrate on
Activity
Numbers and they are the focus for data entry. An Activity has 38 fields
and
a Master has only 4.

So, my main for is based on the Activity Table. The sub form is based on
the Master Activity table. The subform control on the main form links the
two
using the Master Activity number for both Master and Child. Then, as I
stated earlier, the subform has Data Entry set to No, Cycle set to Current
record, it has no navigation capabilites, or any way to move off the
current
record.

Also, in many cases, the Master Activity and Activity numbers will be the
same, so when a new Activity record is added, my code populates the Master
Activity and Description fields of the sub form and leaves the two other
controls Null.

I have tried to find a way to fool it and add a second record, but have
not,
so as far as I can tell, this is working for me.

Thanks for that Klatuu, I *think* I understand ;-)
What advantage would you say there is over having the Master data as the
main form and Activities as the subform? I'm not questioning or criticising
your design but this concept is new to me and I'm just trying to get me head
around it.

Regards,
Keith.
 
Technically, there is no advantage. It is for user convenience. They work
and think in Activity. To them Master Activity is an afterthought. With
this configuration, they don't have to worry about finding the correct Master
then going to the Activity level.
 
Klatuu said:
Technically, there is no advantage. It is for user convenience. They
work
and think in Activity. To them Master Activity is an afterthought. With
this configuration, they don't have to worry about finding the correct
Master
then going to the Activity level.

Understood and noted, many thanks.

Keith.
 
Back
Top