How To Display The Particular Record In Datagrid : Vb 6.0
Hi all, Can anyone tell me how to get a record for particular user or Number In my sql i,v Pinvoice table following fields InvNo int1001 ItemNo 001 002 003 Descrption varchar(20)Fan Chair Table Price float 90 100 20 Qty 2 5 10 Gross 180 500 200 so my question is if type the InvNo(1001) in a textbox this all Records(ItemNo,Descrp,Price,Qty,Gross) i need to display in a grid if i type the another Invno then it has to show me the corresponding InvNo whch i specify in the same grid and in below the Grid i need the total for theGross amount , so can anyone tell me how to do this
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Display Record Set In Datagrid??
Hi I have the code below that queries a database and creates a recordset from it. The code then puts the FirstName value of the record into a textbox. However I also want to display all the records queried in a datagrid. How do I alter the code to allow me to do this? I have a data grid on the form called datDataGrid.
Any help would be greatly appreciated.
Thanks.
Ben.
'Declares the recordset globally for this form
Dim MyRecSet As ADODB.Recordset
-------------------------------------------------------------------
Private Sub btnNext_Click()
' Moves to next record
MyRecSet.MoveNext
' Puts the FirstName value of the first record into a textbox
Me.txtName.Text = MyRecSet.Fields.Item("FirstName")
End Sub
-------------------------------------------------------------------
Private Sub Form_Load()
Dim MyConn As ADODB.Connection
Dim strName As String
'Creating the connection
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=C:Documents and SettingsBenDesktopWADE2CourseworkDatabasehogwarts.mdb;"
MyConn.Open
' Creating a recordset from a query
Set MyRecSet = MyConn.Execute("SELECT FirstName, FamilyName FROM Character")
' Puts the FirstName value of the first record into a textbox
Me.txtName.Text = MyRecSet.Fields.Item("FirstName")
' This needs to go at the end because if it is before the selection
' of data from the recordset then it doesn't work.
' MyConn.Close
End Sub
Display Record On Datagrid
how to display all my records on datagrid ?
i already make the datagrid on my form ( from selecting datagrid component ). but how to define its query source
( i'm using odbc mysql conn) - should i place another component ? what i have to do to make the datagrid display the result of my executed query ?
thanks in advance...
SQL Statement To Display Record In DataGrid
Hello guys!!!!,,,I have tried..tried..tried. but it seems I can't get what I want for my output. If I run my program it displays record in the datagrid but whrn I tried to search position in the textbox it has an error saying 'method open of object failed recordset' pointing to rs.Open sql,cn....
But if I change my sql statement with: sql = sql & " WHERE Cname LIKE '%" & Text1 & "%' order by Cname asc" it works.
My sql statement below searches position and then display the name order by totalscore in ascending order. Thank you ...I hope I make this time around...
Code:
Dim strRS As String
Dim sql As String
Dim rs As New ADODB.Recordset
Dim Cn As ADODB.Connection
Private Sub Form_Load()
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "db1.mdb"
Set Cn = New ADODB.Connection
Cn.Open strConn
strRS = "SELECT * from CandidateScore order by CName asc"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strRS, strConn, adOpenDynamic, adLockOptimistic, adCmdText
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
End Sub
Private Sub Text1_Change()
sql = "SELECT * FROM CandidateScore"
If Len(Text1) <> 0 Then
sql = sql & " WHERE position LIKE '%" & Text1 & "%' order by TotalScore asc"
End If
rs.Close
rs.Open sql, Cn, adOpenDynamic, adLockOptimistic, adCmdText
Set DataGrid1.DataSource = rs
End Sub
Display Currently Selected Record Of A Datagrid In Textboxes?
I have a datagrid control on the form.
What I want to do is the moment user clicks on the rowheader(the little gray button in front of each roa), I want
to display the corresponding records values in text boxes.
Can anyone please help me how to do it?
I have been trying since long, but no luck.
Thanks in advance
Regards
Kalpana
Trying To Input Single Record Number To Textbox And Display Individual Record
Have an input textbox "txtEnterRecNum_LostFocus()", trying to get it so that the user can enter a single record number (1-10) and then THAT one record displays in another textbox "txtDisplayIndividual.Text"
Have coded it to singlely accept one number (for example it is set at number 5), that is ok ... having problems expanding to determine if it's 1,2,3,4,5,6,7,8,9 or 10.
I've played with Do While, Do Until, Ten episodes of IF's (that is long and hokey), tried OR's, tried i <=10, etc., but am not coding correctly as nothing has been successful.
(1) How would I change the following single acceptance code below, to FIRST accept numbers 1,2,3,4,5,6,7,8,9 or 10 and THEN display that particular record?
Code:
Private Sub txtEnterRecNum_LostFocus()
Dim i As Integer
i = 0
Open GetAppPath & "mytext.txt" For Input As #1
Do Until EOF(1)
i = i + 1
Input #1, SampleOutput
If i = 5 Then
txtDisplayIndividual.Text = SampleOutput
Exit Do
End If
Loop
Close #1
End Sub
(2) When it does work for one number, the record displays only if one clicks inside another object/input textbox ... How to make it work no matter where the user clicks on the form?
(3) And how to make it work by pressing ENTER key on the keyboard? (maybe this one is too complicated?)
Entering Record Number And Trying To Display Individual Record
Have an input textbox "txtEnterRecNum_LostFocus()", trying to get it so that the user can enter a single record number (1-10) and then THAT one record displays in another textbox "txtDisplayIndividual.Text"
Have coded it to singlely accept one number (for example it is set at number 5), that is ok ... having problems expanding to determine if it's 1,2,3,4,5,6,7,8,9 or 10.
I've played with Do While, Do Until, Ten episodes of IF's (that is long and hokey), tried OR's, tried i <=10, etc., but am not coding correctly as nothing has been successful.
(1) How would I change the following single acceptance code below, to accept numbers 1,2,3,4,5,6,7,8,9 or 10?
Code:
Private Sub txtEnterRecNum_LostFocus()
Dim i As Integer
i = 0
Open GetAppPath & "mytext.txt" For Input As #1
Do Until EOF(1)
i = i + 1
Input #1, SampleOutput
If i = 5 Then
txtDisplayIndividual.Text = SampleOutput
Exit Do
End If
Loop
Close #1
End Sub
(2) When it does work for one number, the record displays only if one clicks inside another object/input textbox ... How to make it work no matter where the user clicks on the form?
(3) And how to make it work by pressing ENTER key on the keyboard? (maybe this one is too complicated?)
How Do I Show A New Added Record On A Datagrid Locked To A Child Record?
I have 2 datagrids on my form. One locked to the parent table and the other to the child table using the standard Dataenvironment method.
This shows existing child records OK as I change the parent record. When I add a new record to the child table using a separate recordset method, how do I show this addition in the child datagrid? At present I have to stop the program and restart it to see the new record. I've tried all the refresh and rebind thingys I can think of, at the end of my addnew code, without success. I cant find a way of refreshing the child command of the parent in the dataenvironment except in the design mode?
Regards Ted
Click Datagrid Row And Display Details To Another Datagrid
hello there..here i need help. i have a datagrid that retrieve data from database.what i want to do with the datagrid is when i click any rows of the datagrid it can display the details of the data (refer to the row that i click) to another datagrid.
is there possible to be done ?
i want to know if there is any procedure that can capture the datagrid row that i clicked
Display As One Record
Is it possible to insert a set of records into another table as one record using SQL? This is needed because I want to display the set of records in a data report in one line. Please help.
Thanks
Display The First Record
how to make the first record of the table named Prod_Cat and its field named "Cat_Code" to be display in the combo box while the form load?
Record Display
I develpoign application using VB and MS Access
I have written following code
Private Sub Command1_Click ----- to add record
Set rststud = New ADODB.recorset
rststud.open “tblstudents”,dbconn,adOpenkeyset,adLockOptimistic
with rststud
.addnew
!studentid=text1.text
!studentname=text2.text
!joindate=format(“text4.text”,dd/mm/yy)
!leavedate=format(“text4.text”,dd/mm/yy)
.Update
.Requery
.Close
End sub
Private Sub text6_lostfocus() ---- to display record
Set rststud = New ADODB.recorset
rststud.open “Select * from tblstudents where joindate= ‘” & text5.text & “’ and leavdate = ‘”&text6.text & ‘””,dbconn,adOpenkeyset,adLockoptimistic ------- getting error here...
If .Recordcount > 0 then
Set MSHflexgrid1.refresh
MSHflexgrid1.formatstring= “ StudentID | Student Name | Join Date | Leave Date | “
MSHflexgrid1.Datasource=rststud
End if
.Close
End sub
Private Sub Form1_Load ( )
Set dbconn=New ADODB.Connection
Dbconn.connectionstring= “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:student.mdb;Persist Security Info=False
Dbconn.open
Set MSHflexgrid1.refresh
MSHflexgrid1.formatstring= “ StudentID | Student Name | Join Date | Leave Date | “
End Sub
I wanted to display record using two dates..... i.e. from joindate and leavedate....
suppose consider following tablewith data: -
studentid studentname joindate leave date
101 abc 12/02/01 20/02/03
102 bc 12/03/00 20/01/02
103 kb 12/02/02 15/03/05
how to display record on date criterianbasis
suppose i enter date joindate 01/02/01 and leave date 15/01/02 it should diplsay records fall in this criterian.. how should i do
thanks
Display As One Record
Is it possible to insert a set of records into another table as one record using SQL? This is needed because I want to display the set of records in a data report in one line. Please help.
Thanks
Display Only One Record
hi..is there a way of only displaying one record in a data report instead of displaying every record that is in a table? thanks.
Display One Record
Can somebody tell me how I can show one record in Crystal Reports from vb6. I Go from form1 to a crystal report and there I want to show one record that I selected in form1. How can I give the variable through? So form1 gives the value 1 through to chrystal reports and chrystal reports display record nr. 1. Where do I put the variable, only in vb6 or also in Crystal Reports? And where?
Remco Ploeg
ploegr@promar-agencies.nl
Hierarchical Record Display
Hello folks,
I am trying to build a spreadsheat like GUI for a hierarchical recordset. The idea is to display a tree structure in a horizontal display. The is no set amount of nodes and no set amount of levels. Does anyone know of a good way of doing this. Maybe a control that already does this, or some combination of controls that would serve my purpose. I also need it to be functional (i.e. be able to click on any one item of information).
Thank you in advance
Best Control To Display A Record Set
Hi
I have a record set containing 2000+ rows each with four fields.
What is the best method (ie, control to use) to display the data for a user to scroll down through and eventually select one of them.
I have tried using a datagrid (VB6 SP5) but I get a blank grid.
Any help appreciated.
Paul
Code follows:
Private Sub Form_Initialize()
Dim objSelectStmt As New CSelectStmt
Dim objSelectResults As CSelectResults
Dim strSQL As String ' Hold SQL query
strSQL = "SELECT TP, KnownAsName, Description, Description2 FROM fdTradingPartne ORDER BY TP"
Set objSelectResults = objSelectStmt.Execute(strSQL)
If DisplayAndClearErrors(oSession) Then Exit Sub
' Create an instance of the Recordset.
Set rsTradingPartners = New ADODB.Recordset
With rsTradingPartners
.Fields.Append "TradingPartner", adVarChar, 40
.Fields.Append "KnownAsName", adVarChar, 40
.Fields.Append "Description1", adVarChar, 40
.Fields.Append "Description2", adVarChar, 40
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open ' No connection object needed.
End With
objSelectResults.MoveTo (0) ' Move to first record in result set
While Not objSelectResults.EOF ' Process result set
rsTradingPartners.AddNew
If IsNull(objSelectResults.Row(0)) Then
rsTradingPartners!TradingPartner = ""
Else
rsTradingPartners!TradingPartner = objSelectResults.Row(0)
End If
If IsNull(objSelectResults.Row(1)) Then
rsTradingPartners!KnownAsName = ""
Else
rsTradingPartners!KnownAsName = objSelectResults.Row(1)
End If
If IsNull(objSelectResults.Row(2)) Then
rsTradingPartners!Description1 = ""
Else
rsTradingPartners!Description1 = objSelectResults.Row(2)
End If
If IsNull(objSelectResults.Row(3)) Then
rsTradingPartners!Description2 = ""
Else
rsTradingPartners!Description2 = objSelectResults.Row(3)
End If
rsTradingPartners.Update
objSelectResults.MoveNext ' Process next result set row
Wend
Set gridTradingPartner.DataSource = rsTradingPartners ' Associate recordset with grid
gridTradingPartner.Row = 0 ' Ensure that the first in list is visible
gridTradingPartner.Refresh
end sub
Display Next Found Record
hi i was wondering if anyone could help i need to serach through my data base for a name but the problem is two or more people can have the same surname and i would like to display the first find then click a command button to display the next i have the following code at the moemt but it only displays the last record with this name found. Thanks for any help
Private Sub Command3_Click()
Data1.Recordset.OpenRecordset
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
x = Data1.Recordset("Surname")
y = Data1.Recordset("Passcode")
If (UCase(Text1.Text) = x) Or (UCase(Text2.Text) = y) Then
found = True
Call updatevalues
End If
Data1.Recordset.MoveNext
Loop
If (found = False) Then
MsgBox ("not found")
Else
End If
End Sub
after it calls the update value sub the next bit of code ( that i need to change obviousley ) says:
msgbox (("search has found the following ") & (Data1.Recordset("Surname")) & (Data1.Recordset("Passcode")))
Display The Record On The Second Form
hi good day
NOTe: tables: Product_tbl(Product_ID as Numeric is the Primary Key), Supplier_tbl(having Product_ID as Numeric the Foreign Key).
The program requires that all Products are displayed in a form using datagrid (say form1) and when we double click a row a second form will popup displaying the supplier of the clicked product(say form2).
How can I display the list of supplier of that product on the second form using ADO? please help
by the way I'm using MS SQL SERVER 2000.
Limiting The Record To Display
I want to display a record from certain position up to the limit I specified...
In PHP/mySQL can do this by using this code
$limit=10
$start=20
Select * from table LIMIT $start,$limit
the above example will display 10 records from row 20. How to do this in visual basic?
Find And Display A Record
if i was to put a button on to search for a name and display the record, how would i do it.
is it something like
"SELECT * FROM table1 WHERE name = 'casey'"
i have this so far without the search button.
Code:
Option Explicit
Dim con As ADODB.Connection
Dim rec As ADODB.Recordset
Private Sub Form_Load()
Set con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:databaseslah.mdb;"
con.Open
Set rec = New Recordset
rec.Open "SELECT name, phone FROM table1", con, adOpenKeyset, adLockOptimistic
Text1.Text = rec.Fields.Item("name")
Text2.Text = rec.Fields.Item("phone")
End Sub
Private Sub Command1_Click()'move forward
rec.MoveNext
If rec.EOF Then
MsgBox "End of file"
rec.MovePrevious
Else
Text1.Text = rec.Fields.Item("name")
Text2.Text = rec.Fields.Item("phone")
End If
End Sub
Private Sub Command2_Click()'move back
rec.MovePrevious
If rec.BOF Then
MsgBox "Start of file"
rec.MoveNext
Else
Text1.Text = rec.Fields.Item("name")
Text2.Text = rec.Fields.Item("phone")
End If
End Sub
thank you.
casey.
How To Display Last Record From Access
hi all...i have one more question..
I have one textfield to display last record of Invoice Number..
So when user want to add new invoice number..the textfield will show the last invoice number stored in database.
any helping is very much appreciated
thanks in advance
Multiple SQL Record Display
I have created a program that allows users to enter a sales order number, and obtain tracking info from a database... I am using SQL to perform this.... However, some sales order numbers have multiple boxes and/or shipments, and I am not sure how to first get ALL the records, and second display each record discretely....
Can anyone assist me?
Thanks in advance..........
Display Current Record??
I am using the ADO Data Control with access, i have a label where i want it to when the user goes from record 1 to record 2. Basically i wana be able to show the record that the user is on. Is there a way i can do it. I tried with alot of the commands but nothing seems to work
so something like this
You are on record [3] from [5]
Thx for you help.
Why Display Duplicate Record
I have this problem with Data Report. My problem is datareport show duplicate record despite i have specified a range of number from txtpoli1.text to txtpoli2.text
For Example, if i specified 001 to 004. DataReport Show 4 duplicate of 001 . Instead of Displaying 001,002,003,004
VB Code:
Set adoRecordset = New ADODB.RecordsetSQL = "SELECT * FROM tb_master WHERE policyno BETWEEN '" & Txtpoli1.Text & "' And '" & Txtpoli2.Text & "' "adoRecordset.Open SQL, adoConnection, adOpenStatic, adLockOptimistic, adCmdtextadoRecordset.RequerySet PremiumNote.DataSource = adoRecordsetIf adoRecordset.RecordCount > 0 Then Response = MsgBox(adoRecordset.RecordCount & " " & "record selected.Do you want to print?", vbYesNo + vbQuestion, "Record Found") If Response = vbYes Then Call PremiumReport ' This is where i specific Record and show Report End IfElseMsgBox "No Record Found Between these days", vbExclamation, "Date"End If Set adoRecordset = Nothing
i have tried to change the curcor type to adOpenDynamic but when i changed to adOpenDynamic RecordCount Show -1.
Then If i change the curcor type to adCmdTable it give me an ERROR. [Microsoft][ODBC Microsoft Access Driver] sytnax error in FROM clause.
If i use back adOpenStatic and adCmdText, it works but Record duplicate as i mentioned above
Please help. Thank you in at advance
Record Number Display In VBA
i would like to thank those people who helped me to overcome my PREVIOUS problem
my new problem is that i would like to display the number of records in a given table in a text box on a form which is bound to that table. i am working in VBA Access- so any help please?
Large Record To Display
hi,
i have created an application to display data on the grid. for some
reason the only way to populate a grid unbouned is via an array, traversing
it row by row column by column. is there another way of making this process
faster? i'm using hierarchical flex grid by the way.
thanks,
Anthony M. Sagalongos
Wilco International (Australia) Pty Limited
Suite 2, Level 18, 201 Kent Street, Sydney, NSW 2000
EMail : email@removed
Phone : (Direct): +61 2 8259 9058
Phone : (Switch): +61 2 8259 9000
Fax : +61 2 8259 9001
This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify email@removed immediately. You should not copy it or use it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Wilco.
How To Display Record In DBGrid
Hi Friends,
I have ADODC control, DBGrid1 Control and following SQL statemnt.
SQL = Select custid, name, address from Customer
I am unable to display in my result in DBGrid1.
Can you guide or provide sample how to bind the and display result in dbgrid.
What setup do i need to use in ADODC1 and DBGrid1 to display record.
Best Regards
SM
How To Display Record In Combobox If There Is...
Hi everyone
I have one table in sql server. there is null values in fields of this table. When i try to display records in combobox. it doesnt display anything.
using this code
Code:while not rst.eof
combo1.additem rst!cust_name
rst.movenext
wend
rst.close
set rst =nothing
it is not working. Also i am trying to display records in text box then it is displaying that invalid use of null.
So please help me out
Thanx in advance
Edited by - Pyash on 12/19/2004 9:01:35 PM
Record Display Problems
I am having some problems getting data to display in my text boxes.
Here is the connection code:
Code:
With adoSupportInfo
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False;Data Source=" & strPath & _
"; Mode=Read/Write"
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.CommandType = adCmdText
.RecordSource = "SELECT * FROM GetSupportInformation"
.Refresh
End With
Here is the population of the text boxes:
Code:
txtStaffLastName.Text = adoSupportInfo.Recordset("LastName")
txtStaffFirstName.Text = adoSupportInfo.Recordset("FirstName")
txtStaffHomePhone.Text = adoSupportInfo.Recordset("HomePhone")
txtStaffWorkPhone.Text = adoSupportInfo.Recordset("WorkPhone")
txtStaffCellPhone.Text = adoSupportInfo.Recordset("CellPhone")
txtStaffPagerPhone.Text = adoSupportInfo.Recordset("PagerPhone")
selStaffGroup.Text = adoSupportInfo.Recordset("GroupName")
selStaffLocation.Text = adoSupportInfo.Recordset("Location")
Here is the recordset navigation code:
Code:
Private Sub cmdEditFirst_Click()
adoSupportInfo.Recordset.MoveFirst
End Sub
Private Sub cmdEditLast_Click()
adoSupportInfo.Recordset.MoveLast
End Sub
Private Sub cmdEditNext_Click()
If adoSupportInfo.Recordset.EOF Then
MsgBox "You have reached the last record!", vbInformation, "Record Navigation"
Else
adoSupportInfo.Recordset.MoveNext
txtStaffLastName.Refresh
End If
End Sub
Private Sub cmdEditPrevious_Click()
If adoSupportInfo.Recordset.BOF Then
MsgBox "You have reached the first record!", vbInformation, "Record Navigation"
Else
adoSupportInfo.Recordset.MovePrevious
End If
End Sub
When clicking on the navigation buttons it does appear to be moving through
the records but the text boxes are not updating. I was thinking I had to do
some kind of refresh on the text boxes but was not sure how to do that or if
my thinking is all wrong here.
Thanks,
Tim
How To Display A Particular Record In A Adodc
I have a two form application. The first displays all tasks, the second displays (or should) a single task, along with all of the details of audit history for that task.
Using the form wizard, I have the second form displaying 'a' task and the details of that task.
My problem, is how do I get the second form to display a particular task (say TASKID = 5), And how to get this form to change and display a different task when directed to from either the controls or from a public method call?
----
Display Record Without Grid
HI,
i want to show one by one record from begning of record to end of record.
How to do this??
Actually i want to display first record from database when i load the form,then if i make changes to any field in that form and click movenext then it should update it and move to next record.How to do this???
Like without any condition it should show all records and allow me to change and then it should move to next record.
iam fetching data from different table and placing it in the corresponding textbox of the form.
i tried by using while loop but it is not working
please helpme out
Thank u
sowmya s
Display Previous Or Next Record
If I have something like this below,
it searches to show a few records if found of the same name,
how can i add 2 buttons to cmdPrev and cmdNext to display the previous record or the next record
thanks,
Code:
Private Sub cmdSearch_Click()
Dim strFindName
strFindName = InputBox("Search by Name")
Dim strsql As String
Dim rsCust As ADODB.Recordset
Set rsCust = New ADODB.Recordset
strsql = "SELECT * FROM Customer WHERE name LIKE '%" & strFindName & "%' order by id ASC"
Debug.Print strsql
rsCust.Open strsql, adconn, adOpenForwardOnly, adLockReadOnly
If rsCust.RecordCount > 0 Then
Label16.Caption = rsCust.RecordCount & " records found."
End If
If rsCust.EOF = False Then
Text1.Text = rsCust("id")
Text2.Text = rsCust("name")
Text3.Text = rsCust("address")
Text4.Text = rsCust("phone")
Text5.Text = rsCust("fax")
Text6.Text = rsCust("email")
Text7.Text = rsCust("website")
End If
rsCust.Close
Set rsCust = Nothing
Display Record Id That Was Just INSERT-ed
I am using VB with MsAccess
How can I display or use the id of the record that i just INSERT-ed
the id is a autonumber
below are my codes on insert
Private Sub Form_Load()
adconn.Provider = "microsoft.jet.oledb.4.0"
adconn.CursorLocation = adUseClient
adconn.Open App.Path & "db1.mdb"
End Sub
Private Sub cmdSave_Click()
Dim strsql As String
Dim rsCust As ADODB.Recordset
Set rsCust = New ADODB.Recordset
Dim strRecordAffected As String
strsql = "INSERT INTO Customer (name, address, phone, fax, email, website) VALUES ('" & Text2.Text & "', '" & Text3.Text & "', '" & Text4.Text & "', '" & Text5.Text & "', '" & Text6.Text & "','" & Text7.Text & "')"
adconn.Execute strsql
MsgBox ("Record Saved" )
End Sub
I can always do it this way, but aint correct
strsql2 = "SELECT id FROM Customer WHERE name= '" & Text2.Text & "' AND address= '" & Text3.Text & "' AND phone= '" & Text4.Text & "' AND fax= '" & Text5.Text & "' AND email= '" & Text6.Text & "' AND website= '" & Text7.Text & "' "
but it is possible to have two or more of the same and similar data?
there is definetly a better way than that
Display Current Record
In a vehicle maintenance application, I have a list box based on a table, (table1) displayed in a form. The listbox reflects the contents of 2 fields: [EquipmentID] and [PMName].
1. EquipmentID refers to the identification of a vehicle.
2. PMName refers to the name of a preventive maintenance routine at certain intervals ie; PM1, PM2 etc. Each vehicle is assigned its own PM.
3. The table that contains these 2 fields has records for all vehicles and their associated PM's.
I also have table2. Table2 contains static information about each vehicle ie; VehicleID, make, model etc as well as info about when a PM was completed and has a many to one relationship to table1. Thus, table one serves as a lookup table for table2.
The form I am using that has the listbox also has a datasheet type form where I can enter info about each vehicle. As I enter info about each vehicle I would like to be able to visually refer to the listbox to see which vehicles have which PM's assigned to them. However, the listbox displays all of the records for all of the vehicles. How can I filter the records in the listbox to display only those related to the vehicle that I am currently entering information for? Does anyone have any thoughts.
Thank you,
Jim
Display Record Number
How can I add a record number on each record when i display on a datagrid or data report?
Thank you very much your help, and attention.
Chi
Display Record Linked Through A Relation
hi guys,
I'm making a database in access with vb.net as the front end. I've set up the tables and the relations in both access and the dataset schema (do i need both?), and set the primary key and foreign key constraints
What i would like to know is once a record is selected how do i link to another table using the relation and display the correpspond record?
I'm using textboxes to display the data and a button to display the record
How do i do this?
Any help would be appreciated.
Need To Display The Selected Record On DataReport
I have a VB application that displays information of a person in the organization. Now, I am trying to create a VB DataReport that prints out a person's information being displayed on the application. The parameter for the select statement of the report is PERSON_ID (primary key).
Apparently, I cannot define the select statement in the design time since the PERSON_ID wil dynamically change according to the record that I am trying to display. Could you anyone shred me some lights on how to implement this report in the run time? Any source code or sample code will be extremely helpful. Hundred thanks for your help!
Have a good day!
-MH
How To Display No. Of Record In The Data Report?
Hi,
I've create data report and it works fine. My problem is to display no. of record like this,
No. ProjectName StartProject End Project
1 Project1 5/8/2000 6/8/2004
2 .... .... ........
3 ..... ..... .......
do you know how to display the no of record(1, 2, 3..)?
any idea? thanx in advance..
Display A Record In Seperate Textboxes
I have a recordsource,the sql i'm using to obtain it is:
SELECT * FROM [Workers] WHERE [Last Name] = 'Walsh'
workers is a table with 3 columns,last name,first name and id.
i have three text boxes on my form,with the same headings.
i want to show the first name,last name and id of the worker 'Walsh' in the relevant boxes.
i presume its something to do with setting datasource or datamember attributes of the boxes to the name of the recordsource(rs),but ive been trying these and i mustnt be doing it right.
How To Display The Record Mixer With One Button
how to display the Record Mixer with one button
is there a way to do this?
i know ths is how you display the normal volume control mixer
Code:
Dim retval
On Error Resume Next
retval = Shell("c:windowssndvol32", 1)
On Error Resume Next
retval = Shell("c:windowssystem32sndvol32", 1)
but i need the code for the record mixer
Calculation And Display Record Numbers
Can someone please help!!
I have attached my form. This is a Cartridge Stock take form.
1. When you record a new cartridge in the form. In the Quatity text box (txtqty) when you input the amount, this should update the Balance text box (txtbal).
2. When you select the date installed(DTPickerdinst) the number of cartridges installed should be displayed in the txtnumberinstalled text box.
3. The txtperiod should display the usage period of the cartridge e.g. DTPickerdinst - DTPickerdf.
4. The Total Balance text box(txttotal) should display the total balance in stock i.e txtnumberinstalled + txtbal.
5. The txtrecord should display the current record and should change simulteneously when the previous and next buttons are clicked.
6. The txtresult should display the total number of records. The number should increase when a new record is added.
Your valuable help will be most appreciated.
Eugene.
How To Search For A Record And Display It In Datarid
I have a form which has a datagrid and a text box and a command button. On run time the datagrid gets populated with the records of a particular table. I want the user to enter the record to be found in the text box and when he clicks the cmd button only the record which he is searching for should be displayed in the grid
Lloyd Dsouza
How Display Record On The Vsflex7 Grid
Hi all
have problem of display records on the vsfelx7 grid, IF I have more than 7000 records I want to display all this records. At the time of scrolling vsflex7 scroll bar move up or down if any one can help Please give solutions
How To Display No. Of Record In The Data Report?
Hi,
I've create data report and it works fine. My problem is to display no. of record like this,
No. ProjectName StartProject End Project
1 Project1 5/8/2000 6/8/2004
2 .... .... ........
3 ..... ..... .......
do you know how to display the no of record(1, 2, 3..)?
any idea? thanx in advance..
Search And Display Exact Record
Help me by mailing here!!!
i am developing a small utility for a school as part of my project and there is no one to guide me.here is my problem.please help me
my database has 12 fields in ms access 97.i have in all 4 forms which i have done in vb 6.0.i completed
assigning all the text boxes to the fileds of database using data1 found in toolbox,
Now my menu bar looks like this
file-->open-->form1,form2,form3
when i click on a form and enter the serial number i want all the data back into their respective fields
corresponding serial number. Iused text boxes for these fields and assigned them to database usind Datasource and datafields
please help me
L.Subrahmanyam
|