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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code for saving changes to a table after user selects Add Record

Status
Not open for further replies.

BubbaJean

IS-IT--Management
Jun 5, 2002
111
US
Need code for saving changes to a table after user selects Add Record command or Close form command
the following code works however, it doesn't update to the table unless I force it
See below

Private Sub ActiveFormula()

Select Case Me!txtInvisible
Case "BATTERIES"
Me!PartType = [fmluBat]
Case "CAPACITORS"
Me!PartType = [fmluCap]
Case "CONNECTORS"
Me!PartType = [fmluCon]
Case "CRYSTALS/OSCILLATORS"
Me!PartType = [fmluCO]
Case "ELECTROMECHANICAL"
Me!PartType = [fmluEle]
Case "DIODES"
Me!PartType = [fmluDIO]
Case "HARDWARE"
Me!PartType = [fmluHrd]
Case "FUSES"
Me!PartType = [fmluFus]
Case "INDUCTORS"
Me!PartType = [fmluInd]
Case "INTEGRATED CIRCUITS"
Me!PartType = [fmluIC]
Case "MODULES"
Me!PartType = [fmluMod]
Case "PROTECTION DEVICES"
Me!PartType = [fmluPD]
Case "RELAYS"
Me!PartType = [fmluRel]
Case "RESISTORS"
Me!PartType = [fmluRes]
Case "SOCKETS"
Me!PartType = [fmluSoc]
Case "SWITCHES"
Me!PartType = [fmluSwt]
Case "TRANSFORMERS"
Me!PartType = [fmluTrnf]
Case "TRANSISTORS"
Me!PartType = [fmluTrns]
End Select
End Sub

Private Sub Form_AfterInsert()
Call ActiveFormula
End Sub
 
At the risk of sounding like a idiot, where do I place the code??
 
Wherever in your code you wish the save to occur. In this context, probably right after your End Select statement.

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top