×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!
  • Students Click Here

*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

Jobs

Entering data horizontally on forms

Entering data horizontally on forms

Entering data horizontally on forms

(OP)
I would like to be able to enter data into successive records on a form...horizontally instead of vertically. This would only require 1 field entry for each record. The gain is, I can enter much more data without scrolling (continuous form). I believe 3 or 4 columns would be enough. So, record 1 field 1 is first, record 2 fiel2 1 would be to the right of the first and record 3 field 1 would be to the right of that6. Record 4 field 1 would be under record 1 field 1. Record 5 field 1 would be under record 2 field 1....etc. This example is only showing 3 columns of 3 records but could be 4 & 4.

Like

R1Field1 R2Field1 R3Field1
R4Field1 R5Field1 R6Field1
R7Field1

etc

Can this be done? If so, how?

RE: Entering data horizontally on forms

You can use unbound text boxes with some VBA Code to run the updates.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Entering data horizontally on forms

(OP)
Thanks Duane.

Can you give me one short example with code please?

RE: Entering data horizontally on forms

Can you provide some table and field names? Is there only one field in the table?

Can we assume these are just new records?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Entering data horizontally on forms

(OP)
Table: Attendee Field Name: NameID

I will use a combo box to look up a person and it will populate the NameID field with the NameId from the Combo box. The NameID will be an auto generated number.

Thanks,

RE: Entering data horizontally on forms

From your requirements, this should add the records to a table

CODE --> vba

Private Sub cmdSave_Click()
    'this assumes there are consecutively numbered controls with a specific prefix
    Dim intNameCount As Integer
    Dim intI As Integer
    Dim intAdded As Integer
    Dim strSQL As String
    Dim strCtrlNamePrefix As String
    intNameCount = 12  'the number of controls here
    strCtrlNamePrefix = "cboNameID"
    For intI = 1 To intNameCount
        If Not IsNull(Me(strCtrlNamePrefix & intI)) Then
            strSQL = "INSERT INTO Attendee (NameID) Values (" & Me(strCtrlNamePrefix & intI) & ")"
            CurrentDb.Execute strSQL, dbFailOnError
            intAdded = intAdded + 1
        End If
    Next
    MsgBox "Added " & intAdded & " names to Attendance table.", vbInformation + vbOKOnly, "Complete"
End Sub 

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: Entering data horizontally on forms

(OP)
Thanks Duane I will give this a try. Question...does the number controls equate to the number of horizontal controls I want?

RE: Entering data horizontally on forms

Quote (puforee)

does the number controls equate to the number of horizontal controls I want
There is no horizontal or vertical in my solution, only control names. Place the controls in a circle if you desire.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

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!

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