How I can Add a New Record on a Subform

  • Thread starter Thread starter tasos
  • Start date Start date
T

tasos

Hello,

new to this group.
In an application that I write I stoped to a problem.

I have selected through a combo box a value and then the code opened
the Main Data Input form focused in that value.
The problem is that I need after the opening of the Main Form with the
DoCmd.OpenForm statement to have the linked subform be in a blank new
record, ready for data input.
Can someone help me a bit in how i can accomplish this?

Thank you in advance,

tasos
 
hi there - - it is very easy (once you know how to do it.....)

go to Forms and find that subform and open it in Design View

in the upper left where the left side & top of the form meet is a black
square....right click on that and select Property....

go down that list and you will find one named "Data Entry" change that
from no to yes

then save your change.....
 
Firstly thanks for the replay, but

sorry I think I haven't write the problem correctly. Well I mean I know
this and the propertie is correctly set up. I really need to have the
main form populated and be able to put a new record in the subform.
With more details:
The main form desplays the data of the product and for that product i
need to put a new record to the subform to describe new set of
characteristics.

The main-form/sub-form system is triggered by cliking on a button in
the main swichboard, then one intermidiate form appears for the user to
select a product-id and after taking this data the combo-box
afterupdate event code makes a Docmd.OpenForm to the main-form with
where condition the data taken.
After that I need the main-form be populated with the relevant of the
input data and the subform be at a "add new record" state.

Hope I let you understand,

Tasos
 
while I think I understand - - but if my prior suggestion doesn't work then
maybe I don't understand.......

for me; using the technique that I described before; when the subform opens
it opens to New Record......and in my case the SubForm opens when the Main
Form opens....and it works just fine...

perhaps a way to close and re-open the SubForm - - like with a new "Add
Details" button or something....- not exactly sure of your end user
dynamics....but the subform should open correctly to new record using this
technique so possibly you can get creative with this and make it work as I
don't really have any easier approach without going to a VB coding
approach.....other wizard readers though may have some other ideas....
 
Well thank you very much and I am very pleased about this
communication.
I know that the above technique works but unfortunatelly my
form/subform system meets the need of a record browser also, so I would
rather need a way of putting the subform in add new record state at
will. I have no problem of using VB code. I have used quite enough till
now but in this I have stucked.
If the call to the subform was done via a button at the main form I
would knew what to to. The problem starts when the form has to be
opened from the afterupdate event of a combobox located in an
intermidiate form.
Thanks again in advance,

tasos
 
OK !

I finally found the solution to my problem.

After the DoCmd.OpenForm statment that opened my main form I put a
complete reference to the subform's control name and the focus on it.
Then with a < DoCmd.RunCommand acCmdRecordsGoToNew> statment did my
job.

Thank you all for ur help.
 
Back
Top