FAO: Albert D. Kallal (MVP)

J

James

For some reason this is not working it just sits and does
nothing when you ask it to.

Its strange I can see what the code is supoosed to do but
it is just not doing it for one reason or another.

Any Other Suggestions?

Would you like to see the database?

Many Thanks

James
 
J

James

For Attention Of

But anyone can help its just that the above named answred
my last post...

Cheers

James
 
F

Fred Boer

Thanks, James! I've wondered about that for some time! Abbreviation
dictionaries always gave me "Food and Agriculture Organization" or something
like that!
But anyone can help its just that the above named answred
my last post...

Well, since this is a new thread, I'm not sure where your original post is,
but, it probably wouldn't matter anyway, since I'm the farthest thing from
an expert! <g> Hope you get some expert help, though!


Cheers!
Fred
 
K

Kelvin

I'm not sure what your original posting was but based on what I see this
code will only work if your form is being opened to the new record
(DoCmd.OpenForm,,acNewRec) or something similar, since it is in the OnLoad
event. If your form isn't being opened in this fashion, the code will not
work. If you are navigating to the new record either using the arrows or by
code, you should move this code to the OnCurrent event.

Kelvin
 
A

Albert D. Kallal

Note sure of the context of HOW this 2nd form is opened. However, my example
will only work for adding one record. I.e.: open that 2nd form, add the
record, and then close the form.

I suppose if you need the ability to move around, and add more then one
record at a time (I don't like that kind of UI, but you certainly could try
moving the code to the on-insert event

You thus would get:

me!RefNum = forms!FormFirst!RefNum


The above one line of code should do the trick. Of course, this does mean
that the 2nd form will always assume the first form is opened...
 
J

James

I get an object required error when I open the form. I
have opened it with the code and everything and I have
told the form that once the form has opened and excecuted
the code it will then make my first for invisible but it
is still open...

What is the "object" that it is refreing to? Do you have
any ideas?

Many Thanks

James

P.S. If it is easier to have a look at the database that
would be fine as there is no data in it at the moment just
some random stuff...
 
A

Albert D. Kallal

Hum, what happens when you remove the one line of code that sets the id?

It sounds like you have some other problem here. Does your code compile ok
*before* you try and run it? (you want to do a save and compile all while in
the code window).

Does the code run when you remove the code that sets the form to not
visible?

Make a copy of the form, and then start removing code from that from until
the error goes away, that way you can pin point the problem.
 

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