I want to use SQL statement in VB to set the value for a field on a form, and part of that SQL statement is 2 other form fields that have been filled out.
User fills out server name and datbase name.
Then third field is to update with the location of the database file.
Something like this?
Right now, after I update that 2nd field the 3rd is just filling with this actual statement. Not the results. Is it my syntax or my approach? Any suggestions, please?
misscrf
It is never too late to become what you could have been ~ George Eliot
User fills out server name and datbase name.
Then third field is to update with the location of the database file.
Something like this?
Code:
Private Sub txtDatabaseName_AfterUpdate()
Me.txtDatabaseLocation = "Select filename from " & "SELECT tblServerName.txtServerName FROM tblServerName WHERE (((tblServerName.PKServerNameID)=[Forms]![frmProject]![FKServerName])); " & ".master.dbo.sysdatabases " _
& "WHERE name = me.txtDatabaseName"
End Sub
Right now, after I update that 2nd field the 3rd is just filling with this actual statement. Not the results. Is it my syntax or my approach? Any suggestions, please?
misscrf
It is never too late to become what you could have been ~ George Eliot