473,396 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

modify a form and subform

i make a table

1.Add= =Now(), 2. modify (in main form default value is =Now()), 3.Action =Text (in add Form default value is ‘Add’ and in Modify main Form ‘Modify’) 4. ID=Auto number 5. Description=text, 6. VchSeries=text, 7. VchNo=text, 8. Dateoftransaction=Date
9. Debitaccount=text 10. CreditAccount=text 11. Amount=number 12. Narration=text 13. shortNarration =Text

Expand|Select|Wrap|Line Numbers
  1. Private Sub Save_Click()
  2. On Error Resume Next
  3.  
  4.  'add data to table
  5.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  6.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount & "' , " & [Form1]!txtDebit & ")"
  7.  
  8.  
  9.  'add data to table
  10.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  11.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount1 & "' , " & [Form1]!txtDebit1 & ")"
  12.  
  13.  'add data to table
  14.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  15.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount2 & "' , " & [Form1]!txtDebit2 & ")"
  16.  
  17.  'add data to table
  18.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  19.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount3 & "' , " & [Form1]!txtDebit3 & ")"
  20.  
  21.  'add data to table
  22.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  23.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount4 & "' , " & [Form1]!txtDebit4 & ")"
  24.  
  25.  'add data to table
  26.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  27.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount5 & "' , " & [Form1]!txtDebit5 & ")"
  28.  
  29.  'add data to table
  30.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  31.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount6 & "' , " & [Form1]!txtDebit6 & ")"
  32.  
  33.  'add data to table
  34.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  35.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount7 & "' , " & [Form1]!txtDebit7 & ")"
  36.  
  37.  'add data to table
  38.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  39.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount8 & "' , " & [Form1]!txtDebit8 & ")"
  40.  
  41.  'add data to table
  42.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  43.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount9 & "' , " & [Form1]!txtDebit9 & ")"
  44.  
  45.  'add data to table
  46.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  47.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount10 & "' , " & [Form1]!txtDebit10 & ")"
  48.  
  49.  'add data to table
  50.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  51.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount11 & "' , " & [Form1]!txtDebit11 & ")"
  52.  
  53.  'add data to table
  54.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  55.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount12 & "' , " & [Form1]!txtDebit12 & ")"
  56.  
  57.  'add data to table
  58.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  59.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount13 & "' , " & [Form1]!txtDebit13 & ")"
  60.  
  61.  'add data to table
  62.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  63.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount14 & "' , " & [Form1]!txtDebit14 & ")"
  64.  
  65.  'add data to table
  66.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  67.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount15 & "' , " & [Form1]!txtDebit15 & ")"
  68.  
  69.  'add data to table
  70.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  71.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount16 & "' , " & [Form1]!txtDebit16 & ")"
  72.  
  73.  'add data to table
  74.     CurrentDb.Execute "INSERT INTO 6_Transaction (Add, Action, Description, VchSeries, VchNo, Dateoftransaction, Debitaccount, Narration, Creditaccount, Amount)" & _
  75.     "VALUES (# " & Me.txtAdd & " # , '" & Me.txtAction & "' , '" & Me.cboDiscraption & "' , '" & Me.cboSeries & "' , '" & Me.txtVchNo & "' , # " & Me.txtDate & " # , '" & Me.cboParty & "' , '" & Me.txtNaration & "' , '" & [Form1]!cboAccount17 & "' , " & [Form1]!txtDebit17 & ")"
  76.  
  77.  
  78.  
  79.  
  80.   DoCmd.RunCommand acCmdClose
  81.  
  82.   DoCmd.OpenForm "FrmSaleAdd"
  83.  
  84.  
  85. End Sub
Modify
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command192_Click()
  2. 'check whether there data in list
  3. If Not (Me.QryNewCaseQuery_subform.Form.Recordset.EOF And Me.QryNewCaseQuery_subform.Form.Recordset.BOF) Then
  4. 'get data to text box
  5. With Me.QryNewCaseQuery_subform.Form.Recordset
  6. Me.txtAdd = .Fields("Add")
  7. Me.cboDiscraption = .Fields("Description")
  8. Me.cboSeries = .Fields("VchSeries")
  9. Me.txtDate = .Fields("DateofTransaction")
  10. Me.cboParty = .Fields("Debitaccount")
  11. Me.txtNaration = .Fields("Narration")
  12. [Form1]!cboAccount = .Fields("Creditaccount")
  13.  
  14.  
  15. End With
  16.  
  17. End If
Mar 28 '16 #1
1 1338
i make a table

1.Add= =Now(), 2. modify (in main form default value is =Now()), 3.Action =Text (in add Form default value is ‘Add’ and in Modify main Form ‘Modify’) 4. ID=Auto number 5. Description=text, 6. VchSeries=text, 7. VchNo=text, 8. Dateoftransaction=Date
9. Debitaccount=text 10. CreditAccount=text 11. Amount=number 12. Narration=text 13. shortNarration =Text

create a unbound form in main form load field Add , Description, VchSeries , Vch No, Date of transaction and debitaccount
and sub form same above fields and mainy time repeat ID creditaccount and its amount
and child link is Add
Attached Files
File Type: docx Doc1.docx (642.3 KB, 251 views)
Mar 28 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Josh C. | last post by:
Hello everyone. I'm a bit of an Access newbie, so please bear with me. Please go to http://www.dumoti.com/access/ to view the database - 536kb. I'll go straight into examples: In the form...
3
by: Simone | last post by:
Hi All, I have a Find Record button setup in most of my forms in order to find a specific customer's details. I have just noticed today though that this search will only find the customer if it...
5
by: ego | last post by:
Hi all , I had created the following Form/SubForm structure : MainForm SubForm A (SubForm of MainForm) SubForm B (SubForm of SubForm A) SubForm C (SubForm of SubForm B) SubForm D ...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
10
by: Thelma Lubkin | last post by:
My form/subform combination that allows user to display 'ColorSet' records, move to other records via a selector, to add,delete, and edit them, and to manage the related 'Color' records from the...
3
by: ghat12 | last post by:
Hi, I have created a form containing 5 textfields/combo boxes and a command button to conduct searches for matching records. My results are currently displayed as a separate datasheet which is...
5
by: Ron | last post by:
Hi All, I've got a form called frmCust that has a subform on it called sfrmBalance. sfrmBalance's control source is a query called qryTrans4CustBal. sfrmBalance has one field on it called...
2
by: hawg1 | last post by:
I'm fairly new to Access and need help with form/subform. I've seen another access database in which a main form allowed the user to enter school class specific information shuch as start date,...
3
by: Steve | last post by:
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks!
1
by: troy_lee | last post by:
I have a table (Table A). It has one field, a PK. It is in a 1:M with another table (Table B). I am having trouble with a form/subform setup to view the 1:M records. On the parent form, there is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.