|
Тема |
pak MS Access |
|
Автор |
RollinStoner (ne sym kato vas) |
|
Публикувано | 19.01.05 10:00 |
|
|
sorry che vi spamvam taka, ama nali sme si nashi hora
i have another problem, the values in [list 0u], [list 1n] etc. bi triabvalo da se resetvat na 0 pri vsiako natiskane na butona. da ama nomera stava samo poniakoga, a poniakoga ne stava i ne moga da namera nikakyv pattern.
kakvo se opitvam da naprava is to get the number of itmes on hand from [main table]. the items are clasified in categories from [0 untested re] to [5 dead re]
the user will type in the number of items that were listed for sale on e-bay from [list 0u] to [list 5d]
then i am using an update query to subtract the number of items listed from the number of items on hand. the query is called [query listing update]
for example the query updates the field [0 untested re] to [Main Table]![0 untested re]-[Main Table]![list 0u]
then i use an append query to keep a record of what has been listed
after that i set the values in [list 0u], [list 1n] etc. to 0
the reason i do that is beacuse - lets say we hav 5 items on hand but we only want to list 3, the user wants to be able to list some or all of the items in one listing so they have to type in the number every time.
and then if there are no more items left on hand the record is deleated.
any help will be very appreciated, sorry za nagliiskia ama terminologiata mi e po lesna.
here is the code:
Private Sub listing_update_Click()
On Error GoTo ErrorHandler
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenQuery "query listing Update", acNormal, acEdit
DoCmd.OpenQuery " query append arc", acNormal, acEdit
Me![list 0u] = 0
Me![list 1n] = 0
Me![list 2r] = 0
Me![list 3m] = 0
Me![list 4m] = 0
Me![list 5d] = 0
Me![e-bay number] = Null
Dim intSum As Integer
intSum = Nz(Me.[0 untested re], 0) + Nz(Me.[1 new re], 0) + Nz(Me.[2 repaired re], 0) + Nz(Me.[3 minor defect re], 0) + Nz(Me.[4 major defect re], 0) + Nz(Me.[5 dead re], 0)
If intSum = 0 Then
'This will delete the current record on the form.
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
ExitHere:
Exit Sub
ErrorHandler:
MsgBox Err.description
Resume ExitHere
End Sub
|
| |
|
|
|