HELP! 2 questions on refreshing data

G

Guest

Question 1:

I have managed to work out how to create a cascading combo that starts with
no records in either combo box. I have a button that runs an append query
that is only enabled if a customer name has been typed in the first combo.

At first I wondered why the information isn't appended to the table until I
realised I had to move out and then back into the record for the append to
work.

How can I run the query without having to do this?


Question 2:

In the same form I have another button which initiates a macro that runs two
queries. The first query appends the current record to another table which
works fine and the second query deletes the current record from the
underlying table for the form.

After record is deleted I get "#deleted" in each field. What is the best way
of not getting this.

Cheers!
 
G

Guest

(1) Anytime you run something that changes the displayed record, yiou have to
do a requery of the record source to see the changes.
(2) Anytime you delete the currently displayed record, you will get this
since you are still positioned on the record but the data has gone. You need
to change the record you are positioned on.

By the way I would strongly advise against using macros - convert them to VB
instead.

-Dorian
 
J

John Ortt

I might be able to help on question 2....

try putting the following code after the delete record to move you to the
first record.

DoCmd.GoToRecord , , acGoTo, 1

HTH John
 
G

Guest

Thanks for the reply. It occurred to me that Q2 wasn't really necessary.

Q1) I assume it would be the "after
Q2) Why not use macros?
 
G

Guest

I think I've sorted it out now.

thanks


mscertified said:
(1) Anytime you run something that changes the displayed record, yiou have to
do a requery of the record source to see the changes.
(2) Anytime you delete the currently displayed record, you will get this
since you are still positioned on the record but the data has gone. You need
to change the record you are positioned on.

By the way I would strongly advise against using macros - convert them to VB
instead.

-Dorian
 
G

Guest

I think I've sorted it out now.

thanks


John Ortt said:
I might be able to help on question 2....

try putting the following code after the delete record to move you to the
first record.

DoCmd.GoToRecord , , acGoTo, 1

HTH John
 

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