Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

programically autofill records

Status
Not open for further replies.

juanahusted

Programmer
Jul 3, 2004
4
US
need to set up a series of inventory locations. They will be "T03A" thru "T03Z". I need to set up at least 20 sets (thru "T20A-Z")

Is there VBA code out there that can autofill the alpha letters?
 
Loop creating an SQL statement?

Dim i As Integer
Dim j as Integer
Dim str As String

For i = 3 To 20
For j = 65 To 90
str = "INSERT INTO YourTable(YourField) VALUES '"
str = str & "T" & Replace(" ","0",Space(Len(i)) & i)
str = str & Chr(j) & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL str
DoCmd.SetWarnings True
Next
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top