×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-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

*Eng-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

Link VB text box to Data Set

Link VB text box to Data Set

Link VB text box to Data Set

(OP)
Hello!

I am trying to take the data from an edit box, edt1.text and enter it into a field Product ID in my datagrid. This will then go to my Access database. I can do the second part but not the first.

I have added in a data binding link from the edit box to the field, so when i type the data manually it will update in the database. I am thinking of using an SQL statement to do this but I can't seem to get it correct....

Any help would be great...

Pam

RE: Link VB text box to Data Set

The data in your TextBox called ed1 are written as a character string.The max length  is about 32000 characters (probably 2^15, I have not counted).In a VBa you can move this character string into a string variable, like   a$=ed1.text.
With len(a$) you get the length of the string in ed1.
Alternativelly you assign to the pointer to the start point of the character string in ed1  a very large value, larger then the last character in your string, like
       Let ed1.SelStart=30000
in this case it will give you back the position of the last character and you can intercept the result easily by
      lastcharacter=ed1.SelStart
Again you get the length of the character string.
Maybe there is a more elegant way but I do not know it.
From now on it is routine: you should find separators among data fields( space? comma?...?)and move each group of characters that represent a single data into whatever cell you wish.
m777182

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 Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

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

Click Here to join Eng-Tips and talk with other members!


Resources