Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.
Private Sub Command40_Click() Dim myFlds As String, myVals As String, mysql As String, myArray As Variant myArray = Split(Me!tbxContents, vbCrLf) 'array element per line of tbxContents For i = 0 To UBound(myArray) myFlds = myFlds & Left(myArray(i), InStr(myArray(i), "=") - 1) & ", " 'the single quotes in the next line denote text fields myVals = myVals & Trim("'" & Mid(myArray(i), InStr(myArray(i), "=") + 1)) & "'," Next i myFlds = Left(myFlds, Len(myFlds) - 2) 'remove trailing comma space myVals = Left(myVals, Len(myVals) - 1) 'remove trailing comma myVals = myVals & ")" mysql = "INSERT INTO BikeFlightLegit ([From], To, Received, Created, HasAttachments, " & myFlds & ") Values ('" & Me!From & "', '" & Me!To & "',#" & Me!Received & "#,#" & Me!Created & "#,'" & Me!HasAttachments & "'," & myVals & ";" MsgBox mysql DoCmd.SetWarnings False DoCmd.RunSQL mysql DoCmd.SetWarnings True End Sub INSERT INTO BikeFlightLegit ( [From], [To], Received, Created, [Has Attachments], Company, Name, Address1, Address2, City, State, Zip, Country, EmailAddress ) VALUES ('', 'firstname.lastname@example.org', #8/22/2008 16:18:17#, #8/22/2008 15:48:33#, '0', 'Millicent Pty Limited', 'Terry L. Farmer 1', 'Address1', 'Address1', 'City1', 'State1', 'Zip1', 'USA', 'email@example.com 1');
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.