Hi guys can you all help me with this. I need to sure will the this idea can be make in vb6. I have a update command button. When click then type the badge id , it will automatic get the data and show the employee name then the rest of the information also will show in the update form. So will this can be done and need to use what to code to write it ?

Help me please please

Recommended Answers

All 4 Replies

Yes it is possible, and with way too many ways in which to describe in just a single post. So lets break your question down into simple strait forward tasks.

First, you have badge ID's. How do you display them? ComboBox, Grid of some sorts, or is user supposed to know these badge ID's from memory?

Second, you have employees. How do you access them? Display Them?

Need help with code? Start with data form wizard.


Good Luck

Yes it is possible, and with way too many ways in which to describe in just a single post. So lets break your question down into simple strait forward tasks.

First, you have badge ID's. How do you display them? ComboBox, Grid of some sorts, or is user supposed to know these badge ID's from memory?

Second, you have employees. How do you access them? Display Them?

Need help with code? Start with data form wizard.


Good Luck

1.So the badge ID is the Main Page of my program so when user type it then it will show on the data grid which use the ADODB. connection.

2.The employee also will display at the data grid. Data grid have lot of information.

3. when user press the add command it need to fill up the form then it will save the detail into table1 for active and table2 for not active badge.

4. when the user press the update command button it need to fill up three things first badge ID, employee ID and employee name then the rest of the data will automatic get from table 1 or table 2.

5. When the user at the update page when key in badge id already the employee text field will automatic show the employee id and when user put the employee id, it will auto show the employee name. Then key_pressdown it will show other information and allow user to update.

6. when the user update, if the active combo box put active to not active it will transfer all the info to table1 to table 2. then table 1 will dont have the old data already

Okay, user types in a badge ID that they have in hand, and then hit a search button or a search is done and the data grid is populated with a bunch of information.

Now depending upon if the user is handing the badge to the employee for the employee to use or taking it back you have to either a) make an entry into table1 to note that the badge is in use or b) make an entry into table2 to note that the badge is no longer in use.

So you are going to need an if statement that test to see if information is going into table1 or table2.

Now, if I have understood you correctly so far... If the information is going into table1. Then you will need to insert that information via an insert statement into table1 or if the information is going into table2, then you will also need an insert statement but the values of this insert statement will be coming from table1. After that, then you will need to delete the information from table1.

Okay, so if I have this right then...

If condition means insert into table1 then
INSERT INTO Table1(Field1, Field2, Field3,...) VALUES (Value1, Value2, Value3,...)
Else
INSERT INTO Table2(Field1, Field2, Field3,...) VALUES (Value1 from table1, Value2 from table1, Value3 from table1,...) WHERE Table1.Field = unique criteria
'execute query
DELETE FROM Table1 WHERE Field = unique criteria '(same unique criteria as the insert statement)
End if


I think I have that right...


Good Luck

hey i have the code for ur probs.... for retrieve
give this code for textbox_lostfocus....

recordset_object.open "select * from table_name where batch_id =' " & (batch_idtextbox) &"'",connection_object,adodb.opendynamic

while recordset_obj.eof=false
textbox2.text = recorset_obj(1)
textbox2.text = recorset_obj(1)
recorset_obj.movenext
wend

recordset_obj.close

this command is used to retrieve the datas frm the database table..

For update


recordset_object.open "select * from table_name where batch_id =' " & (batch_idtextbox) &"'",connection_object,adodb.opendynamic

if recordset_object.recordcount>0 then
recordset_object.update
end if

this is for update.. check this commands and reply 2 me in this mail id raju_oct1@yahoo.com

regards

Naga

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.