SQL syntax in VBA

PhilipEwen

Registered User.
Local time
Today, 09:42
Joined
Jun 11, 2001
Messages
81
Hi,
I am trying to add data to a table from a text box..i.e. enter the name into the text box and click the 'add' button - this adds the data to the table.

It has to be an unbound text box, so it has to take the value of the textbox ( NewCountry ) and add it into the countryname field of the countries table.

Thanks for any help
 
Can't you use a combo box to add the record via the not in list event.
 
no.
basically i have a combo box which selects countries and from changing the combo box it changes the subform listing resorts within the country.

What i want to do is add a simple way of adding another country to the table and therefore the combobox.
The when i have added it, i can refersh the mainform which will repopulate the combobox, giving the new country as an extra option.
Then i can go on to the next stage of 'add resort' etc etc

I really just need the VBA syntax for inserting the value of a textbox on the form into the countries database - to assign to an 'Add' button

Thanks
 
found the solution

ss = "INSERT INTO resorts " & "(resortname,transfercost) VALUES " & "(txt_resort_name, txt_trans_cost);"
 

Users who are viewing this thread

Back
Top Bottom