hi
i want 2 table
table1:
OrderCode
OrderDate
LeadTime
.
.
.
Table2:
OrderCode
ID
I want when fill a record in table1 at the same time OrderCode in table2 muts be written exat OrderCode in table1
How do this?
hi
i want 2 table
table1:
OrderCode
OrderDate
LeadTime
.
.
.
Table2:
OrderCode
ID
I want when fill a record in table1 at the same time OrderCode in table2 muts be written exat OrderCode in table1
How do this?
What is table 2 for - order details? One way is to use form/subform arrangement. Main form bound to table 1, subform bound to table 2. Master/Child links set to the OrderCode fields. As soon as you enter a value into the subform record, the subform OrderCode foreign key field will populate. Anything else will require code, I use only VBA, not macros.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Hi,
Make form, link it to table1
Put command button on it.
Behind the Command button put some code like this
Dim Idb As Database
Dim irq As Recordset
Dim Isql As String
Isql = "Select * from table2"
Set Idb = CurrentDb
Set irq = Idb.OpenRecordset(Isql, dbOpenDynaset)
irq.AddNew
irq("ColumnName") = Me.txtTextBoxName
irq("ColumnName") = Me.txtTextBoxName
irq("ColumnName") = Me.txtTextBoxName
irq("ColumnName") = Me.txtTextBoxName
irq("ColumnName") = Me.txtTextBoxName
''''
'''
irq.Update
Set Idb = Nothing
Set irq = Nothing
Isql = ""
I hope it help.