×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Creating a record from a combo box.

Creating a record from a combo box.

Creating a record from a combo box.

(OP)
I have a form on which there are 10 items that must be keyed-in and 1 combo box consisting of 5 items.  If I select 1 of the 5 items from the combo box, how can I make that 1 item into a record that exists with the 10  items that were key-in?
Using Access 2000 and thank you for your reply.

RE: Creating a record from a combo box.

I use a "Save Record" Button but you could probably trigger it on any event. here is a sample of the code I used.

' prompt for confirmation
Dim Msg, Style, Title, Response
Msg = "Save and Close Record Now?"    ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton1    ' Define buttons.
Title = "SAVE RECORD?"    ' Define title.
        
' Display message.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
' Save all values on form

Dim db As Database
Dim rs As Recordset
    
Set db = CurrentDb
Set rs = db.OpenRecordset("tablename", DB_OPEN_DYNASET)
   
rs.AddNew
rs!field1 = Me!control1
rs!field2 = Me!control2
rs!field3 = Me!control3
rs!field4 = Date
rs.Update
End If

Hope this helps

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close