Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't save record in main form!?

Status
Not open for further replies.

gusbrunston

Programmer
Feb 27, 2001
1,234
US
I'm stumped! And I've done the keyword search several ways.
Code:
Source for main form = tblDeposits
(key) DepositID       Autonumber
      DepositNumber   Long integer (increments by 1)
      DepositDate     Date/Time
      Reconciled      Yes/No

Source for sub form  = tblDepositDetails
(key) DepDetailID     Autonumber
      DepositNumber   Long integer (from main form)
      Other stuff....
When I tab out of the last field in the first record of the sub form, the main form record has not been saved. I get an error msg that the record(subform) cannot be saved because there must be a related record in the table "tblDeposits."

I've struggled to save the record in tblDeposits so I can enter data in the sub form to no avail. I've put in command buttons, I've put saving code in the field(s) in the main form.

I can go to the table (tblDeposits) itself, enter records in datasheet view and then the form/subform works fine. But that seems nuts to me.

I've worked on this for a week. (Slept a little, ate twice, showered a couple of times, etc.)

Can you point me to the right button to push? Any help greatly appreciated.

Thanks,

:cool:




Gus Brunston
An old PICKer
padregus@home.com
 
Whoops! Was working from memory (not good).
My key in tblDeposits is DepositNumber (Autonumber)
Gus Brunston
An old PICKer
padregus@home.com
 
Some progress...
In the main form there is a check box for "Reconciled". If I click that box then the form/subform works ok. But why do I have to click that checkbox? It has a default value of no. It should not be checked until the bank statement comes and the deposit shows on the statement. ??? Gus Brunston
An old PICKer
padregus@home.com
 
Well I solved my own problem. (Does it seem like I'm talking to myself here?)
I deleted the relationship between the two tables. Why that fixed it I dunno... Gus Brunston
An old PICKer
padregus@home.com
 
!
Bad idea!
Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top