Hi,
I am inserting into table tbl_Money range of dates choosen by user.
Code:
Code:
Dim dteDate As DateDim dteDateCounter As Date
Dim dteDateEnd As Date
Dim sqlString As String
Dim counter As Byte
Dim Money_value As Currency
dteDate = Format([TextBoxDfrom], "MM/YYYY")
dteDateEnd = Format([TextBoxDTo], "MM/YYYY")
If dteDateEnd < dteDate Then
MsgBox "Data korekty DO powinna być większa niż Data korekty OD)"
End If
dteDateCounter = dteDate
While dteDateCounter <= dteDateEnd
counter = counter + 1
dteDateCounter = DateAdd("m", 1, dteDateCounter)
Wend
Money_value = Textbox_kwota.Value / counter
''dteDateEnd = Month(Forms![Main].[txbDateTo]) & Year(Forms![Main].[txbDateTo])
While dteDate <= dteDateEnd
sqlString = "INSERT INTO tbl_Money(Money_FK, Money_value, Data_korekty) VALUES(" & ID.Value & ", " & Money_value & ", #" & dteDate & "#);"
Debug.Print sqlString
CurrentDb.Execute sqlString
dteDate = DateAdd("m", 1, dteDate)
Wend
QryMoney.Requery
my relationship:
I am afraid that working in split database (a lot of users at the same time) will blow up my code when users will be trying to input range of dates and sums into my table (requering in the same time).
It is possible to workaround this?
How to refresh form in the same record in order to see immiditiely inputed records?
Please help,
Best Wishes,
Jacek