saving [enter a value] in update query

S

Stuart E. Wugalter

Hello!

The following Update Query allows my users to substitute a numerical value
for the phrase "Allele 2" in the field Taqcall. This is run from a command
button on a form for the table:

UPDATE tblSEQTAQ AS A SET A.taqcall = [Enter a Value for Allele 2:]
WHERE (((A.taqcall)="Allele 2"));

I would like to display the value entered to replace "Allele 2" in the
table. That is if the user changes all of the "Allele 2" values to the
number "1," then I want to have the number 1 displayed on the form next to
a caption that reads "Allele 2."

TIA for your help.

Sincerely,

Stuart E. Wugalter
Statistician II
Building: PMB B100
Mail Code: 9011
Department: Zilkha Neurogenetic Institute
Division: Keck School of Medicine
Telephone: (323) 442-1080
FAX: (323) 442-3054
E-Mail: (e-mail address removed)
 
4

456

Hi Stuart,
Assuming that this is a bound form, I'll also assume that you have a text
box control bound to taqcall in tblSEQTAQ. Let's say the bound control is
called txttaqcall. I'd simply set the label caption for the control to
Allele 2. The value of taqcall can be whatever. Then if you wanted to
selectively update the values in taqcall, you could pop up an unbound form
with a combobox showing distinct values in taqcall, a text box to input the
new value, and a command button to execute the update. Something like:

Private Sub Command4_Click() 'cmd button on popup form

Dim sS As String
If Not IsNull(Me.cbotaqcall) AND Not IsNull(Me.txtnewvalue) Then

sS = "UPDATE tblSEQTAQ SET [taqcall]='" & Me.txtnewvalue & "'" & _
"WHERE ((([taqcall])='" & Me.cbotaqcall & "'));"

CurrentDb.Execute sS, dbFailOnError
Else
'error message
End If

End Sub

Hope I understood your situation correctly.
Robert Dale
 

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