need help in vb 6 programming

krishnandu.sarkar

Simply a DIGITian
Staff member
You have to search bro :p

One Trick : Open VB > Go To Files > Recent Projects. Check if it opens and runs fine, if yes go to the folder and take a backup.

Else you may have already moved the whole project to anywhere else.
 
OP
R

rabjabber

Journeyman
never mind,
i did "save as" for every file into a different folder

after that the problem is that even if i have to make a small modification i have to save as in that folder
is there a way i can make the new folder the "working" folder of vb6
i did the "open in" thing and it is opening in the new folder but not saving........
 

krishnandu.sarkar

Simply a DIGITian
Staff member
Did you opened it as Project? If you are opening every form as a file you need to do that, if you open the whole thing as a project, you don't need to. As VB maintains .project / .prj file for that.
 
OP
R

rabjabber

Journeyman
Did you opened it as Project? If you are opening every form as a file you need to do that, if you open the whole thing as a project, you don't need to. As VB maintains .project / .prj file for that.

by open in i mean that the shortcut starts in the new folder

btw i'm opening the whole thing as a project but in the folder /program files(x86)/ visual studio/.............../VB98 there is no .frm or .proj file..........
when i opent it through vb it is there but when i open it in windows explorer it's not, also i tried copying a frm file from the vb window to my desktop it gives the file not found error
 

krishnandu.sarkar

Simply a DIGITian
Staff member
by open in i mean that the shortcut starts in the new folder

btw i'm opening the whole thing as a project but in the folder /program files(x86)/ visual studio/.............../VB98 there is no .frm or .proj file..........
when i opent it through vb it is there but when i open it in windows explorer it's not, also i tried copying a frm file from the vb window to my desktop it gives the file not found error

I didn't understand. You open VB from start menu right? Then how are you opening the project? From Recent Projects menu? Or by clicking on File > Open?
 
OP
R

rabjabber

Journeyman
guys help?


another problem


there is a datagrid on form1 and adodc1 form2. on form2 there are textboxes whose datasource is adodc1 and datafields are also specified for each textbox.

what i want is that whichever record the user selects in the datagrid on form one should be displayed on the textboxes on the form2 textboxes
 

krishnandu.sarkar

Simply a DIGITian
Staff member
recent projects, but both of them seem to work

so, the project is visible just to vb

Ye, that's one of the problem. I'll try to explain all of them...

1. As you are using Recent Projects to open your project, it uses the previous path for the project. And when you change the project folder's path, it's creating problem.
2. Yes .prj / .project files are VB specific, if you want to see those files you need to enable "Show Extension for Recognized Files" on Folder Options depending on the OS you use.
3. I guess you are using Win Vista / Win 7 / Win 8. In any of the cases, you need to open VB6 as "Run as Administrator", as your project file is under Program Files, OS above Win XP doesn't get native rights to write to that folder. And that's why you are facing the problem of saving each of the form in that way (as you said above). Open VB6 as Run as Administrator and your this problem will be solved.

Else copy the project folder to somewhere else (Other than C), and try to open the project in VB from File > Open. Again start VB as Run as Administrator.

Hope that helps. Let me know :)

guys help?


another problem


there is a datagrid on form1 and adodc1 form2. on form2 there are textboxes whose datasource is adodc1 and datafields are also specified for each textbox.

what i want is that whichever record the user selects in the datagrid on form one should be displayed on the textboxes on the form2 textboxes

Ok, this is specific to programming, I'll try to jot down the steps here...

1. Declare a public variable in Form2.
2. Now whenever someone selects something in Data Grid, set the public variable of Form2 to the ID of the selected Row and open Form2.

That's it :)

NOTE : I used VB6 around 3 years ago, so I'm not sure which event occurs while selecting rows in Datagrid in VB :p So please google the appropriate Event do the steps mentioned above in that event :)
 
OP
R

rabjabber

Journeyman
Ye, that's one of the problem. I'll try to explain all of them...

1. As you are using Recent Projects to open your project, it uses the previous path for the project. And when you change the project folder's path, it's creating problem.
2. Yes .prj / .project files are VB specific, if you want to see those files you need to enable "Show Extension for Recognized Files" on Folder Options depending on the OS you use.
3. I guess you are using Win Vista / Win 7 / Win 8. In any of the cases, you need to open VB6 as "Run as Administrator", as your project file is under Program Files, OS above Win XP doesn't get native rights to write to that folder. And that's why you are facing the problem of saving each of the form in that way (as you said above). Open VB6 as Run as Administrator and your this problem will be solved.

Else copy the project folder to somewhere else (Other than C), and try to open the project in VB from File > Open. Again start VB as Run as Administrator.

Hope that helps. Let me know :)



Ok, this is specific to programming, I'll try to jot down the steps here...

1. Declare a public variable in Form2.
2. Now whenever someone selects something in Data Grid, set the public variable of Form2 to the ID of the selected Row and open Form2.

That's it :)

NOTE : I used VB6 around 3 years ago, so I'm not sure which event occurs while selecting rows in Datagrid in VB :p So please google the appropriate Event do the steps mentioned above in that event :)

thanks for the reply but i don't think you get any of my problems...........

first of all the project file and the form file are not visible in the windows explorer........ but they are visible from the vb pop up boxes of existing project and file>open... so i did save as for each form in D drive and now they are visible.

second i know that is what i have to do but i don't know the syntax and the commands for making that specific record visible in the textboxes because by default the last navigated record is selected so what is the property of adodc that selects the records to display
 

krishnandu.sarkar

Simply a DIGITian
Staff member
thanks for the reply but i don't think you get any of my problems...........

first of all the project file and the form file are not visible in the windows explorer........ but they are visible from the vb pop up boxes of existing project and file>open... so i did save as for each form in D drive and now they are visible.

Ohh sorry, I have no idea too :(

second i know that is what i have to do but i don't know the syntax and the commands for making that specific record visible in the textboxes because by default the last navigated record is selected so what is the property of adodc that selects the records to display

Well, you need to learn VB bro. Learn or google it :p It's simple. I just said you the logic.
 
OP
R

rabjabber

Journeyman
guys,
i'm using the following code to display a record i double click on (in the datagrid) to display it onto the other form

Code:
Private Sub DataGrid1_DblClick()
Load viewstaff
    viewstaff.Adodc1.Recordset.MoveFirst
    viewstaff.Adodc1.Recordset.Find "ID = " & _
       Adostaff.Recordset.Fields("ID").Value & "", , , 0
    viewstaff.Show
End Sub

it shows runtime error 3001
arguements are of wrong types, are out of acceptable range or are in conflict with each other
after clicking debug it highlights
Code:
Private Sub DataGrid1_DblClick()
Load viewstaff
    viewstaff.Adodc1.Recordset.MoveFirst
    [U][I][B]viewstaff.Adodc1.Recordset.Find "ID = " & _
       Adostaff.Recordset.Fields("ID").Value & "", , , 0[/B][/I][/U]
    viewstaff.Show
End Sub

datagrid1 and adodc1 are on one form called staff
adodc1 is linked to an access database table called staff and has a field ID (yes, in caps)
the
 
Top Bottom