View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lonnie M. Lonnie M. is offline
external usenet poster
 
Posts: 184
Default Updating Worksheet Through User Form

HI, try adding this after you copy to the 1st database:

myFileNameDir = "\\sharedrive\ShareFile\Public\StuData.xls"
Workbooks.Open Filename:=myFileNameDir, UpdateLinks:=0
Set ws = ActiveSheet.Name

'copy the data to the 2nd database
ws.Cells(iRow, 1).Value = Me.txtStudentName.Value
ws.Cells(iRow, 2).Value = Me.txtClassId.Value
ws.Cells(iRow, 3).Value = Me.txtStudentID.Value
ws.Cells(iRow, 4).Value = Me.txtRegNo.Value
ActiveWorkbook.Save
ActiveWorkbook.Close


HTH--Lonnie M.