BleepingComputer.com: Wanted Visual Basic Guru

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Wanted Visual Basic Guru Use of Reference Numbers

#1 User is offline   donuteh 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 25
  • Joined: 04-April 07
  • Gender:Male
  • Location:100 Mile House

  Posted 05 January 2010 - 12:46 PM

I'm new to Visual basic and I'm sure this is something I should already know. I'm creating a Database to keep track of Deviation reports, each Deviation report has a reference number. (The reference number is located in Column A in case that helps) I have a user form that will help the user to fill the information into the correct places. When I enter the reference number into the text box and hit the command button (I called it "Find") it fills out the user form with all information that is already available. however, what I'm trying to do is be able to update it. I would like to select the row that contains the selected reference number and when I hit update, I'd like to overwrite the whole row.
So far I have it acting the same as my new deviation report button. I'm sure it's something as simple as creating a couple variables and telling it what to do with them, but I'm just not seeing it.

Any help would be greatly appreciated.
Thank you in advance,

:thumbsup: Dirk
The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

#2 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 05 January 2010 - 01:05 PM

Is your 'database' just a text file?

EDIT: Err, just to be clear, I do not consider myself a 'guru'. What you are asking sounds trivial; I just need some clarification.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#3 User is offline   Keithuk 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 800
  • Joined: 25-January 07
  • Gender:Male

Posted 06 January 2010 - 08:20 AM

View Postdonuteh, on Jan 5 2010, 05:46 PM, said:

I'm new to Visual basic and I'm sure this is something I should already know.


Visual basic is a misconception.

Which version are you using VB6 or VB.Net? VB keywords are the only link between them.

If your new to VB then it looks like VB.Net 2005, 2008 or 2010? :thumbsup:
Keith

Martin2k

Windows ME (spare computer)
Windows XP 2002 Professional SP3 (desktop computer)
Windows Vista Home Premium SP2 (laptop computer)

#4 User is offline   donuteh 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 25
  • Joined: 04-April 07
  • Gender:Male
  • Location:100 Mile House

Posted 06 January 2010 - 09:27 AM

My Database is an Excel file, I'm using VB 6.5 which seems to be integrated as part of Excel 2007. My boss is usually the one doing these things but he's busy so now I'm doing it. I am new to VB (about 2 weeks) so I don't know a whole lot yet.
Thank you for your replies, it's good to know there are people out there who are willing to help a noob like me. :-)
The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

#5 User is offline   Keithuk 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 800
  • Joined: 25-January 07
  • Gender:Male

Posted 06 January 2010 - 12:50 PM

View Postdonuteh, on Jan 5 2010, 05:46 PM, said:

My Database is an Excel file, I'm using VB 6.5 which seems to be integrated as part of Excel 2007.


Thats another misconception there has never been a VB6.5 but I think we are on the older VB track. :thumbsup:
Keith

Martin2k

Windows ME (spare computer)
Windows XP 2002 Professional SP3 (desktop computer)
Windows Vista Home Premium SP2 (laptop computer)

#6 User is offline   donuteh 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 25
  • Joined: 04-April 07
  • Gender:Male
  • Location:100 Mile House

Posted 06 January 2010 - 02:25 PM

lol ok you got me, it actually says version 6.5.1040 I'm not really sure what that's supposed to mean but there you have it, version 6 followed by a bunch of random numbers. I got it from the Help menu/ about Microsoft Visual Basic... probably doesn't actually mean anything, I sometimes think that the only thing some of the Microsoft updates to is update that number. You think??? :thumbsup:
The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

#7 User is offline   donuteh 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 25
  • Joined: 04-April 07
  • Gender:Male
  • Location:100 Mile House

Posted 07 January 2010 - 05:18 PM

Never mind, I figured it out, it took me little while but I did it, now I'm proud of myself. :-) Thanks to anyone who may have been working on this for me, I'm still interested to see what other people come up with. here's mine for anyone who might have the same question I had.

Sub Update()

Dim lrow As Long, x As Integer
Dim rng As Range, cell As Range
Set rng = Range("A2:A" & Cells(65536, "A").End(xlUp).Row)
If (Application.WorksheetFunction.CountIf(rng, TextBox25.Value) >= 1) Then
For Each cell In rng
If (cell.Value = TextBox25.Value * 1) Then

'Selects cell at beginning of required row
lrow = cell.Row And cell.Select
  
'places information from text fields into the appropriate cells
ActiveCell.Offset.Value = TextBox9.Value
ActiveCell.Offset(0, 1).Value = TextBox2.Value
ActiveCell.Offset(0, 2).Value = TextBox1.Value
ActiveCell.Offset(0, 3).Value = TextBox3.Value
ActiveCell.Offset(0, 4).Value = TextBox4.Value
ActiveCell.Offset(0, 5).Value = TextBox5.Value
ActiveCell.Offset(0, 6).Value = TextBox6.Value
ActiveCell.Offset(0, 7).Value = ComboBox1.Value
ActiveCell.Offset(0, 8).Value = TextBox7.Value
ActiveCell.Offset(0, 9).Value = TextBox8.Value
ActiveCell.Offset(0, 10).Value = TextBox10.Value
ActiveCell.Offset(0, 11).Value = TextBox11.Value
ActiveCell.Offset(0, 12).Value = TextBox12.Value
ActiveCell.Offset(0, 13).Value = TextBox13.Value
ActiveCell.Offset(0, 14).Value = TextBox14.Value
ActiveCell.Offset(0, 15).Value = TextBox15.Value
ActiveCell.Offset(0, 16).Value = TextBox16.Value
ActiveCell.Offset(0, 17).Value = TextBox17.Value
ActiveCell.Offset(0, 18).Value = TextBox18.Value
ActiveCell.Offset(0, 19).Value = TextBox19.Value
ActiveCell.Offset(0, 20).Value = TextBox20.Value
ActiveCell.Offset(0, 21).Value = TextBox21.Value
ActiveCell.Offset(0, 22).Value = TextBox22.Value
ActiveCell.Offset(0, 23).Value = TextBox23.Value
ActiveCell.Offset(0, 24).Value = TextBox24.Value
ActiveCell.Offset(0, 25).Value = TextBox27.Value
ActiveCell.Offset(0, 26).Value = TextBox28.Value
ActiveCell.Offset(0, 27).Value = TextBox29.Value
ActiveCell.Offset(0, 28).Value = TextBox30.Value
ActiveCell.Offset(0, 29).Value = TextBox31.Value
ActiveCell.Offset(0, 30).Value = TextBox32.Value
ActiveCell.Offset(0, 31).Value = TextBox33.Value
ActiveCell.Offset(0, 32).Value = TextBox34.Value
ActiveCell.Offset(0, 33).Value = TextBox35.Value
ActiveCell.Offset(0, 34).Value = TextBox36.Value
ActiveCell.Offset(0, 35).Value = TextBox37.Value
ActiveCell.Offset(0, 36).Value = TextBox38.Value
ActiveCell.Offset(0, 37).Value = TextBox39.Value
ActiveCell.Offset(0, 38).Value = TextBox40.Value
ActiveCell.Offset(0, 39).Value = TextBox41.Value
ActiveCell.Offset(0, 40).Value = TextBox42.Value
ActiveCell.Offset(0, 41).Value = TextBox43.Value
ActiveCell.Offset(0, 42).Value = TextBox44.Value
ActiveCell.Offset(0, 43).Value = TextBox45.Value
ActiveCell.Offset(0, 44).Value = TextBox46.Value
ActiveCell.Offset(0, 45).Value = TextBox48.Value
ActiveCell.Offset(0, 46).Value = TextBox49.Value
ActiveCell.Offset(0, 47).Value = TextBox45.Value
ActiveCell.Offset(0, 48).Value = TextBox51.Value
ActiveCell.Offset(0, 49).Value = TextBox52.Value

Exit For
End If
Next cell
Else
MsgBox ("No Match Found")
End If

End Sub

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

#8 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 07 January 2010 - 10:23 PM

For those who did not understand like me, donuteh is talking about VBA included in Microsoft Office products.

#9 User is offline   Keithuk 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 800
  • Joined: 25-January 07
  • Gender:Male

Posted 08 January 2010 - 07:56 AM

Thanks Romeo29 this topic is getting as clear as mud by the day.

When I first read this it was talking about databases I assumed Access but that code is using an Excel Sheet. So is this a combination of both of them Dirk? :thumbsup:
Keith

Martin2k

Windows ME (spare computer)
Windows XP 2002 Professional SP3 (desktop computer)
Windows Vista Home Premium SP2 (laptop computer)

#10 User is offline   donuteh 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 25
  • Joined: 04-April 07
  • Gender:Male
  • Location:100 Mile House

Posted 08 January 2010 - 09:01 AM

Oh, sorry, my bad. Yes, I am using a database created in Excel, I've never worked with Access because my boss is afraid of it, which is weird because he used to do a lot of work with it when he worked for Canadian Airlines.
The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users