Erasing Values in tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a problem with my Forms. I have a combo Box which works find but
when I use check for another CTAName the first search had replaced the first
CTAName with it's address. What is going on here?

I have to replace the info in the Table. I don't want the users having to
do this.

I want the ComboBox to keep the same info as the Table and not move items
around.

Is there a way for this not to happened?
 
The Combo Box that I'm using also inserts the data into the rest of the text
boxes that is on the form. I read that I needed an bound combobox.

The CTAName is being replaced by Address and the Number is being dup by the
next number in the table.

Here is my query:

SELECT DISTINCTROW qry_CTAMainTest.CTAName, qry_CTAMainTest.Number,
qry_CTAMainTest.Address, qry_CTAMainTest.CTACity, qry_CTAMainTest.CTAState,
qry_CTAMainTest.Zip, qry_CTAMainTest.CTAPhone, qry_CTAMainTest.CTAFax,
qry_CTAMainTest.CTAEmail, qry_CTAMainTest.CTARegion,
qry_CTAMainTest.CTAEligibility, qry_CTAMainTest.Reopening1,
qry_CTAMainTest.Reopening2, qry_CTAMainTest.CTAContactName1,
qry_CTAMainTest.CTAContactPhone1, qry_CTAMainTest.CTAContactFax1,
qry_CTAMainTest.CTAContactEmail1, qry_CTAMainTest.CTAContactName2,
qry_CTAMainTest.CTAContactPhone2, qry_CTAMainTest.CTAContactFax2,
qry_CTAMainTest.CTAContactEmail2, qry_CTAMainTest.CTAContactName3,
qry_CTAMainTest.CTAContactPhone3, qry_CTAMainTest.CTAContactFax3,
qry_CTAMainTest.CTAContactEmail3, qry_CTAMainTest.CTAContactName4,
qry_CTAMainTest.CTAContactPhone4, qry_CTAMainTest.CTAContactFax4,
qry_CTAMainTest.CTAContactEmail4 FROM qry_CTAMainTest;

Also is there a way to have the form bring up a blank form each time it's
open as it shows the first row and if there is no data in the Next CTANAme it
leaves all the data from the previous one?
 
Can you scroll through the records? If so, use the wizard to create a combo
box. To do this, click View > Toolbox. Click the magic wand icon at the top
of the toolbox so that it is highlighted. Click the combo box icon, and draw
a combo box on the form. When the wizard appears, choose the third option
(select a record based on my combo box selection, or something like that).
If you look at the SQL code at the combo box row source you will probably see
something like:

SELECT DISTINCTROW qry_CTAMainTest.CTAName
FROM qry_CTAMainTest
ORDER BY qry_CTAMainTest.CTAName;

It will be an unbound combo box. If somebody has another plan you will need
to speak to that person.

I don't quite understand your second question. If you want to open to a new
record you can put the following in the form's Open event:

DoCmd.GoToRecord , , acNewRec

If you want to open to the last record you can make that:

DoCmd.GoToRecord , , acLast

In the second case you could have a command button on the form to duplicate
the record. If you need something more elaborate than that I suggest you
start a new thread, as I am not really able to provide the assistance you
need.
 
Back
Top