Getting / Manipulating Data From Another table

R

Robbie Gilbert

I would like to update the current table with a number contained in another
table, then add 1 to
The source table number so that the number will be unique for the next
record added.
The tables do have a relationship established.

Simply –


Location_ID
Source_Number


Location_ID
Destination_Number


I want the value of source number in destination number, (If Destination is
Blank), then add 1 to Source Number. Tables have a relationship by
Location_ID.

I have played with this – but keep getting errors! Help!!

Thanks

Robbie
 
B

Bob Miller

If you base a form on your first table and place a sub-form in that for
based on the second table (linked by Location_ID) entered info in th
two forms will havethe same Location_ID. Entering a Location_ID in th
main form will pass it to the sub-form and subsequently second table.
 
R

Robbie Gilbert

I have the tables linked - thats not my problem - i want to get the # from
the 2nd table, put in the first table, then add 1 to the number in the source
table so I have a unique number for the next record added in the source table
- with the same location ID. Note - autonummber will not work - since
numbers have to be by location ID.
 
R

Robbie Gilbert

This is what I am Trying to do -

Private Sub Indictment___BeforeUpdate(Cancel As Integer)
If IsNull(Me![Indictment #]) = True Then
Me![Indictment #] = Counties![indictment # 2]
Counties![indictment # 2] = Counties![indictment # 2] + 1
End If


End Sub
 
Top