Losing Focus

I

Ian

I have a form with multiple subforms. The main form is
called client_info. There are two subforms properties and
service_record. I have inserted a button that opens an
append query to add a bunch of records to the service
record. It grabs the [propertyID] and inserts it with the
additional info multiple times into the service_record.
I have a problems:
1. If you change anything in the properties subform
before hitting the action button it fails to pic up the
[propertyid]. I assume it's somehow lost focus form the
main (client_info) form. If I go back and forward in the
records first - it works no problem. The action button
opens the macro - is there any command in the macros that
will let me go back and forward in the main form - I
tried records>>next and previous but it failed (same
problem?). Should I be setting the focus to the main
form first or can I refresh it somehow first?

Long explaination to a short problem - hope someone can
help.

Thanks.
 
T

Todd Shillam

I know the SendKeys command emulates keyboard typing--this might be an option. I have used the SendKeys command in macros before. Here's an example:

SendKeys "+{TAB}"

NOTE: The '+' symbol emulates the {Shift} key. So this command emulates the {Shift}+{TAB} key strokes, thus moving form focus backwards by one.

Best regards,

Todd
I have a form with multiple subforms. The main form is
called client_info. There are two subforms properties and
service_record. I have inserted a button that opens an
append query to add a bunch of records to the service
record. It grabs the [propertyID] and inserts it with the
additional info multiple times into the service_record.
I have a problems:
1. If you change anything in the properties subform
before hitting the action button it fails to pic up the
[propertyid]. I assume it's somehow lost focus form the
main (client_info) form. If I go back and forward in the
records first - it works no problem. The action button
opens the macro - is there any command in the macros that
will let me go back and forward in the main form - I
tried records>>next and previous but it failed (same
problem?). Should I be setting the focus to the main
form first or can I refresh it somehow first?

Long explaination to a short problem - hope someone can
help.

Thanks.
 
A

Andi Mayer

I have a form with multiple subforms. The main form is
called client_info. There are two subforms properties and
service_record. I have inserted a button that opens an
append query to add a bunch of records to the service
record. It grabs the [propertyID] and inserts it with the
additional info multiple times into the service_record.
I have a problems:
1. If you change anything in the properties subform
before hitting the action button it fails to pic up the
[propertyid]. I assume it's somehow lost focus form the
main (client_info) form. If I go back and forward in the
records first - it works no problem. The action button
opens the macro - is there any command in the macros that
will let me go back and forward in the main form - I
tried records>>next and previous but it failed (same
problem?). Should I be setting the focus to the main
form first or can I refresh it somehow first?

Long explaination to a short problem - hope someone can
help.

what are your refering: the textbox or the field (table or query)?

it looks like you refer to the field and this field is not saved,
therefore you get a Null
 

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