查看: 1037|回复: 11
|
请教 MS Access problem
[复制链接]
|
|
All,
Sorry for not typing chinese word as this is urgent and don't have s/w to keyin chinese charaters.
this problem i am facing is how to i write VB code in my access project.
please email me at [email protected]. so i can attach me mdb file to you and show you the problem i am facing.
please this is urgent..i really really need help.
thank you in advance. |
|
|
|
|
|
|
|
楼主 |
发表于 4-5-2005 09:08 AM
|
显示全部楼层
Viewer 于 3-5-2005 23:03 说 :
All,
Sorry for not typing chinese word as this is urgent and don't have s/w to keyin chinese charaters.
this problem i am facing is how to i write VB code in my access project.
please email ...
hello, why no reply. i try to describe the problem i am facing.
it is fine i can add record to field in table. but how do i add record to field after i key a product name and it need to be change automatically like following:
Table
ProductID ProductCode QTY Price
1 LMNO 100 RM10
2 LMON 100 RM10
3 LOMN 100 RM10
4 OLMN 100 RM10
5 OLNM 100 RM10
6 ONLM 100 RM10
7 NOLM 100 RM10
8 NOML 100 RM10
9 NMOL 100 RM10
10 MNOL 100 RM10
11 MNOL 100 RM10
12 MONL 100 RM10
13 OMNL 100 RM10
14 OMLN 100 RM10
15 OLMN 100 RM10
16 LOMN 100 RM10
17 LONM 100 RM10
18 LNOM 100 RM10
19 NLOM 100 RM10
20 NLMO 100 RM10
21 NMLO 100 RM10
22 MNLO 100 RM10
23 MNOL 100 RM10
24 MONL 100 RM10
from above sample, we know that we can only keyin LMNO, then the rest could do by VB code. but this is the problem i am facing, how to add in the VB code and how to write VB program to perform this task.
the productCode support is very long. please help, this is urgent.i could email you the simple *.mdb if possible, so you may know my problem.
thank you very much |
|
|
|
|
|
|
|
发表于 4-5-2005 09:08 AM
|
显示全部楼层
|
|
|
|
|
|
|
楼主 |
发表于 4-5-2005 09:22 AM
|
显示全部楼层
sorry, i know i shouldn't use english, but my pc have not chinese s/w + this is urgent case for me. please |
|
|
|
|
|
|
|
发表于 4-5-2005 02:14 PM
|
显示全部楼层
你可以在 Access 做一个 form 来输入资料. 制作一个 form 的时候, 你可以选择是 based on 那一个 table 的, 这样 Access 会自动帮你弄好. |
|
|
|
|
|
|
|
楼主 |
发表于 4-5-2005 05:35 PM
|
显示全部楼层
goatstudio 于 4-5-2005 14:14 说 :
你可以在 Access 做一个 form 来输入资料. 制作一个 form 的时候, 你可以选择是 based on 那一个 table 的, 这样 Access 会自动帮你弄好.
hi Goatstudio,
i did create form,but i don't want to key in every records like i show u that table. i just want to key in 1st record, the rest will be handled by VB module, event or macro automactically.
Please check your message, i have short message for you.
btw, thank you for you reply and help. if any one know how to solve my problem, please help as a lot of different product coming in store and a lot of human mistake now if i keep on using paper for recording.
THANK YOU ALL VERY VERY MUCH.once again i apology for not using chinese wording, i know this is following conditions, but i have no choice as no chinese s/w. i did try to use pocket pc chinese writing and transfer the file to here, but the format can't be converted. |
|
|
|
|
|
|
|
发表于 5-5-2005 08:49 AM
|
显示全部楼层
你可以制作简单的 form, 那 form 里只有一个 button, 在那 button 的 onclick event 里, 放上 [Event Procedure], 里面可以制作你的 vb 来输入. |
|
|
|
|
|
|
|
发表于 5-5-2005 08:57 AM
|
显示全部楼层
你是打算以 Access来制作一个Inventory System记录所有的来货资料吗? |
|
|
|
|
|
|
|
楼主 |
发表于 5-5-2005 08:58 AM
|
显示全部楼层
goatstudio 于 5-5-2005 08:49 说 :
你可以制作简单的 form, 那 form 里只有一个 button, 在那 button 的 onclick event 里, 放上 [Event Procedure], 里面可以制作你的 vb 来输入.
Yes, you are right, i have already done this and know where to find onclick event, now this is the problem i need help how to write VB code to perform this task as i don't know how VB well?
or what is the code for add record? i really blank for vb programing as i am not expert in programming
Thank you very much. |
|
|
|
|
|
|
|
发表于 5-5-2005 09:03 AM
|
显示全部楼层
你是指当你输入 ProductID后,有关Product的名称和资料会自动显示,你只需要输入来货数量,价钱,日期...是吗? |
|
|
|
|
|
|
|
发表于 5-5-2005 10:14 AM
|
显示全部楼层
Viewer 于 5-5-2005 08:58 AM 说 :
Yes, you are right, i have already done this and know where to find onclick event, now this is the problem i need help how to write VB code to perform this task as i don't know how VB well?
...
你的 product code 在 10, 11, 12 出现问题.
要制作出这样的 product code, 用以下的 code... 但是输入 database 的 sql 你就自己去研究啦.
Dim OriginString As String, tmp As String, LastChar As String
Dim StrLength As Integer, x As Integer, y As Integer, counter As Integer
Dim StrArray
OriginString = "LMNO"
StrLength = Len(OriginString)
' create array
tmp = ""
For x = 1 To StrLength
tmp = tmp & Mid(OriginString, x, 1) & " "
Next
StrArray = Split(tmp)
For x = 0 To (StrLength - 1)
counter = StrLength
For y = 1 To (StrLength - 1)
LastChar = StrArray(counter - 1)
StrArray(counter - 1) = StrArray(counter - 2)
StrArray(counter - 2) = LastChar
tmp = Join(StrArray, "") ' product code
counter = counter - 1
' generate sql and insert into database here
Next
Next |
|
|
|
|
|
|
|
楼主 |
发表于 5-5-2005 05:46 PM
|
显示全部楼层
goatstudio 于 5-5-2005 10:14 说 :
你的 product code 在 10, 11, 12 出现问题.
要制作出这样的 product code, 用以下的 code... 但是输入 database 的 sql 你就自己去研究啦.
Dim [/color ...
hi Goatstudio,
thank you very much, I will keep on 研究. your help is very much appreciated
thank you very very much. |
|
|
|
|
|
|
| |
本周最热论坛帖子
|