Creating New Record from button

D

Dean

I am having difficulty in creating a new record when I
press a command button. On a form I have a listbox with a
number of items eg peices of equipment. What I want to do
is select an item from the listbox, then press the command
button to open a form, and creates is a new record with
the selected equipment details already there. The new
record being a maintanence record for this equipment

Now I have tried upteen times to work it out using the
docmd.open "form1",,,"euip.equipid = " & lstbox.column(0)
but all this is doing is creating a new record without the
equipment being there. Can anyone help

any additional explanation can be given if needed

Thanks in advance
 
P

Paul

Try

docmd.open "form1"
Forms("form1").equipid.Value = Me.lstbox.Column(0)

You appear to be setting the Where Condition argument in the code you post
(which would limit you to viewing *existing* records with that EquipId).
 
G

Guest

Have tried your solution, but can't seem to get it to
work. Access doesn't under stand docmd.open, tried using a
variable to pass the form name and value1=value2. If
possible could you give me an example of the full string
needed to open the form using an example

Very much appreciated if possible

thanks
 
D

Deano

Sorted it.

Couldn't see what you where saying and took a while to see
what was going on.


Thanks for geting back to us
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top