Setting data defaults programmatically

J

Jim Kennedy

Hi,
Instead of changing the default value of the table, I
would focus on the form. Here's one way I did this. I
added a command button next to the text box I wanted to
set the default value and added this code:

Private Sub cmdAccession_Click()
Dim strDefault As String

strDefault = Chr(34) & Me.Accession & Chr(34)

Me.Accession.DefaultValue = strDefault

End Sub
 

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