Biomechanoids
Programmer
Hello,
I need to read the value of a particular field of a current record in form. I think the currentrecord method only gives out the number of the record, so that it will not possible to use this.
I need this to creat a directory with a certain name. For example: If I enter a new customer I can click on a buttom in the form and the macro creats automatically a directory with the name of the customer.
For example: my customer has th name "xxx12". I enter this in the form, press the button and my macro should take the name out of the table and creat the directory with a command like this:
Private Sub Command26_Click()
Dim verbindung As ADODB.Connection
Dim datensatz As New Recordset
Dim verbindungsaktivierung As String
Dim abfrage As String
Dim kontrolle As Integer
Dim rs As DAO.Recordset
'setup of the databaseconnection
Set verbindung = CurrentProject.Connection
verbindungsaktivierung = "SELECT *FROM projectdatabase" 'selects whole table
Set datensatz.ActiveConnection = verbindung
datensatz.Open verbindungsaktivierung, , adOpenForwardOnly, adLockReadOnly, adCmdText
Set rs = valueoffieldclient
MkDir "F:\USER\PROJECT TEAMS\" & rs!client
MkDir "F:\USER\PROJECT TEAMS\" & rs!client & "\spec"
rs.Close
Set rs = Nothing
On Error
MsgBox "A directory has already been created"
End If
End Sub
It would be nice if somebody would give me a hint how to solve this problem.
Greetings
Thomas
I need to read the value of a particular field of a current record in form. I think the currentrecord method only gives out the number of the record, so that it will not possible to use this.
I need this to creat a directory with a certain name. For example: If I enter a new customer I can click on a buttom in the form and the macro creats automatically a directory with the name of the customer.
For example: my customer has th name "xxx12". I enter this in the form, press the button and my macro should take the name out of the table and creat the directory with a command like this:
Private Sub Command26_Click()
Dim verbindung As ADODB.Connection
Dim datensatz As New Recordset
Dim verbindungsaktivierung As String
Dim abfrage As String
Dim kontrolle As Integer
Dim rs As DAO.Recordset
'setup of the databaseconnection
Set verbindung = CurrentProject.Connection
verbindungsaktivierung = "SELECT *FROM projectdatabase" 'selects whole table
Set datensatz.ActiveConnection = verbindung
datensatz.Open verbindungsaktivierung, , adOpenForwardOnly, adLockReadOnly, adCmdText
Set rs = valueoffieldclient
MkDir "F:\USER\PROJECT TEAMS\" & rs!client
MkDir "F:\USER\PROJECT TEAMS\" & rs!client & "\spec"
rs.Close
Set rs = Nothing
On Error
MsgBox "A directory has already been created"
End If
End Sub
It would be nice if somebody would give me a hint how to solve this problem.
Greetings
Thomas