Thanks
If anyone is looking to soemthing like this. It appears that this works
Private Sub Command0_Click()
DoCmd.TransferSpreadsheet acImport, 8, "Table1", "M:\teststuff\mtd.XLS", True, "Sheet1!b1:q48"
'DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Table1", "M:\teststuff\mtd.XLS", False, "Sheet1!b5:q48"
DoCmd.OpenQuery "DeleteNullValues", acViewNormal, acEdit
DoCmd.OpenQuery "append ids", acViewNormal, acEdit
End Sub
With DeleteNullValues being:
DELETE Table1.[_name], Table1.start_date, Table1.[_life], Table1.[_ann], Table1.[_di], Table1.[_LAD], Table1.[_LTC], Table1.[_SPLR], Table1.[_t2 Ann], Table1.[_rs], Table1.[_lcm], Table1.[_mmlisi], Table1.[_mmliai], Table1.[_total], Table1.lad_renewal, Table1.pers_rate
FROM Table1
WHERE (((Table1.[_name]) Is Null)) OR (((Table1.[_name]) Not Like "*(*"));
With append ids being:
UPDATE Table1 LEFT JOIN [get numbers] ON Table1.[_name] = [get numbers].[_name] SET Table1.[id number] = [get numbers].[yourans];
Refering back to get numbers:
SELECT "AA" & PadZeros(Mid([Table1].[_name],InStr([Table1].[_name],'(')+1,Len([Table1].[_name])-InStr([Table1].[_name],'(')-1),6) AS YourAns, Table1.[_name]
FROM Table1;
Refering back to padzeros which was mentioned above but it is:
Public Function PadZeros(TheStr As String, MyLen As Byte) As String
While Len(TheStr) < MyLen
TheStr = "0" & TheStr
Wend
PadZeros = TheStr
End Function
And now I also know that I can call a function in a query, pretty cool.
Thanks.
It also occures to that this was what Kodo was trying to get at as well.
(sorry kodo I misunderstood)