473,729 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to retrieve records submmited on a form

kev
Hi all,

I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of time.

Thanks a lot!!

Dec 7 '06 #1
13 3432
Kev, you have not told us why you are doing this the hard way.

Just create a form bound to your table. There is no need for any code,
button, or tying to retrieve the data. You can use the built-in navigation
buttons at the bottom of the form to move to a new record, enter it, and it
saves and displays without any code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** *************@j 72g2000cwa.goog legroups.com...
>
I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of time.

Thanks a lot!!

Dec 7 '06 #2
kev
Hi Allen,

Thank you for a quick reply but i am still not getting the solution for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)

I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the database.

Pls reply asap as my project relies very much on this..

Thanks again and sorry for any inconveniences caused

Allen Browne wrote:
Kev, you have not told us why you are doing this the hard way.

Just create a form bound to your table. There is no need for any code,
button, or tying to retrieve the data. You can use the built-in navigation
buttons at the bottom of the form to move to a new record, enter it, and it
saves and displays without any code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** *************@j 72g2000cwa.goog legroups.com...

I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of time.

Thanks a lot!!
Dec 7 '06 #3
Kev, bear in mind that we don't know:
- how many tables are involved,
- what primary keys and foreign keys are involved,
- how you submit the data,
- how you retrieve the data and populate the controls on your unbound form.

It is therefore impossible to advise you on what process you need.

The example below illustrates how to use an Append query statement to write
a record to a table, and then retrieve the AutoNumber value. Hopefully you
know how to OpenRecordset on that particular record from there, and you can
also apply the same approach to the related tables where the answers to the
individual questions in your survery are presumably stored. Note that this
requires at least Access 2000.

Function ShowIdentity() As Variant
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine(0)(0)
db.Execute "INSERT INTO MyTable ( MyField ) SELECT 'nuffin' AS Expr1;"

Set rs = db.OpenRecordse t("SELECT @@IDENTITY AS LastID;")
ShowIdentity = rs!LastID
rs.Close

Set rs = Nothing
Set db = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hi Allen,

Thank you for a quick reply but i am still not getting the solution for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)

I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the database.

Pls reply asap as my project relies very much on this..

Thanks again and sorry for any inconveniences caused

Allen Browne wrote:
>Kev, you have not told us why you are doing this the hard way.

Just create a form bound to your table. There is no need for any code,
button, or tying to retrieve the data. You can use the built-in
navigation
buttons at the bottom of the form to move to a new record, enter it, and
it
saves and displays without any code.

"kev" <ke******@gmail .comwrote in message
news:11******* **************@ j72g2000cwa.goo glegroups.com.. .
>
I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of time.

Thanks a lot!!

Dec 7 '06 #4
kev
Hi Allen,

I really hope you can teach me about recordsets-how to create it and
OpenRecordset.
Please help as i am a fresh beginner starting from zero knowledge about
this.

And also, i came across the article "How to retrieve a querydef from Ms
Access using DAO".
Will this method solve my existing problem?

Thanks a million!

Allen Browne wrote:
Kev, bear in mind that we don't know:
- how many tables are involved,
- what primary keys and foreign keys are involved,
- how you submit the data,
- how you retrieve the data and populate the controls on your unbound form.

It is therefore impossible to advise you on what process you need.

The example below illustrates how to use an Append query statement to write
a record to a table, and then retrieve the AutoNumber value. Hopefully you
know how to OpenRecordset on that particular record from there, and you can
also apply the same approach to the related tables where the answers to the
individual questions in your survery are presumably stored. Note that this
requires at least Access 2000.

Function ShowIdentity() As Variant
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine(0)(0)
db.Execute "INSERT INTO MyTable ( MyField ) SELECT 'nuffin' AS Expr1;"

Set rs = db.OpenRecordse t("SELECT @@IDENTITY AS LastID;")
ShowIdentity = rs!LastID
rs.Close

Set rs = Nothing
Set db = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hi Allen,

Thank you for a quick reply but i am still not getting the solution for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)

I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the database.

Pls reply asap as my project relies very much on this..

Thanks again and sorry for any inconveniences caused

Allen Browne wrote:
Kev, you have not told us why you are doing this the hard way.

Just create a form bound to your table. There is no need for any code,
button, or tying to retrieve the data. You can use the built-in
navigation
buttons at the bottom of the form to move to a new record, enter it, and
it
saves and displays without any code.

"kev" <ke******@gmail .comwrote in message
news:11******** *************@j 72g2000cwa.goog legroups.com...

I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of time.

Thanks a lot!!
Dec 7 '06 #5
kev
Sorry ..forget to include this code in:
Sub GetQueryDef()
'This sub will get data from an Existing QueryDef in the
Northwind
'database and place the data on sheet2.

Dim Db As Database
Dim Qd As QueryDef
Dim Rs As Recordset
Dim Ws As Object
Dim i As Integer
Dim Path as String

'Set the Path to the database. This line is useful because
'if your database is in another location, you just need to change
'it here and the Path Variable will be used throughout the code.
'
'If you're using Microsoft Office 97, the line should read:
'
'Path = "C:\Program Files\Microsoft
'Office\Office\ Samples\Northwi nd.mdb"
'
Path = "C:\Msoffice\Ac cess\Samples\No rthwind.mdb"

'Set Ws
Set Ws = Sheets("Sheet1" )

'This set of code will activate Sheet1 and clear any existing
data.
'After clearing the data, it will select cell A1.
Ws.Activate
Range("A1").Act ivate
Selection.Curre ntRegion.Select
Selection.Clear Contents
Range("A1").Sel ect

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).O penDatabase(Pat h, ReadOnly:=True, _
Exclusive:=Fals e)
Set Qd = Db.QueryDefs("I nvoices")

'Create a new Recordset from the Query based on the stored
'QueryDef.
Set Rs = Qd.OpenRecordse t()

'This loop will collect the field names and place them in the
first
'row starting at "A1."
For i = 0 To Rs.Fields.Count - 1
Ws.Cells(1, i + 1).Value = Rs.Fields(i).Na me
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cel ls(1, 1), Ws.Cells(1, Rs.Fields.Count )).Font.Bold
_
=True

'The next line will get the data from the recordset and copy it
'into the Worksheet (Sheet1).

Ws.Range("A2"). CopyFromRecords et Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1" ).Select
Range("A1").Sel ect
Selection.Curre ntRegion.Select
Selection.Colum ns.AutoFit
Range("A1").Sel ect

Qd.Close
Rs.Close
Db.Close

End Sub

Where do i attach this code to? at which field? which event?
kev wrote:
Hi Allen,

I really hope you can teach me about recordsets-how to create it and
OpenRecordset.
Please help as i am a fresh beginner starting from zero knowledge about
this.

And also, i came across the article "How to retrieve a querydef from Ms
Access using DAO".
Will this method solve my existing problem?

Thanks a million!

Allen Browne wrote:
Kev, bear in mind that we don't know:
- how many tables are involved,
- what primary keys and foreign keys are involved,
- how you submit the data,
- how you retrieve the data and populate the controls on your unbound form.

It is therefore impossible to advise you on what process you need.

The example below illustrates how to use an Append query statement to write
a record to a table, and then retrieve the AutoNumber value. Hopefully you
know how to OpenRecordset on that particular record from there, and you can
also apply the same approach to the related tables where the answers to the
individual questions in your survery are presumably stored. Note that this
requires at least Access 2000.

Function ShowIdentity() As Variant
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine(0)(0)
db.Execute "INSERT INTO MyTable ( MyField ) SELECT 'nuffin' AS Expr1;"

Set rs = db.OpenRecordse t("SELECT @@IDENTITY AS LastID;")
ShowIdentity = rs!LastID
rs.Close

Set rs = Nothing
Set db = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hi Allen,
>
Thank you for a quick reply but i am still not getting the solution for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)
>
I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the database.
>
Pls reply asap as my project relies very much on this..
>
Thanks again and sorry for any inconveniences caused
>
Allen Browne wrote:
>Kev, you have not told us why you are doing this the hard way.
>>
>Just create a form bound to your table. There is no need for any code,
>button, or tying to retrieve the data. You can use the built-in
>navigation
>buttons at the bottom of the form to move to a new record, enter it, and
>it
>saves and displays without any code.
>>
>"kev" <ke******@gmail .comwrote in message
>news:11******* **************@ j72g2000cwa.goo glegroups.com.. .
>
I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem here
is i need to retrieve back the information submitted to display all the
data that the user has input in something like
>
*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia
>
Please help as i need to do it urgently and am running out of time.
>
Thanks a lot!!
Dec 7 '06 #6
Learning to handle recordsets is a bigger topic than we can achieve in a
newsgroup posting.

The function you postded seems to be connecting to spreadsheets, so is not
typical of recordsets in Access.

Recordsets use DAO or ADO. DAO is the native library in Access.

Again, and particularly if recordsets are new to you, I would encourage you
to review why you are wanting to program all this. It would be much better
to learn how to use the interface Access provides. Bound forms can do the
whole job for you. You can adapt them to what you need to achieve.

That's probably as far as I can take you on this one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Sorry ..forget to include this code in:
Sub GetQueryDef()
'This sub will get data from an Existing QueryDef in the
Northwind
'database and place the data on sheet2.

Dim Db As Database
Dim Qd As QueryDef
Dim Rs As Recordset
Dim Ws As Object
Dim i As Integer
Dim Path as String

'Set the Path to the database. This line is useful because
'if your database is in another location, you just need to change
'it here and the Path Variable will be used throughout the code.
'
'If you're using Microsoft Office 97, the line should read:
'
'Path = "C:\Program Files\Microsoft
'Office\Office\ Samples\Northwi nd.mdb"
'
Path = "C:\Msoffice\Ac cess\Samples\No rthwind.mdb"

'Set Ws
Set Ws = Sheets("Sheet1" )

'This set of code will activate Sheet1 and clear any existing
data.
'After clearing the data, it will select cell A1.
Ws.Activate
Range("A1").Act ivate
Selection.Curre ntRegion.Select
Selection.Clear Contents
Range("A1").Sel ect

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).O penDatabase(Pat h, ReadOnly:=True, _
Exclusive:=Fals e)
Set Qd = Db.QueryDefs("I nvoices")

'Create a new Recordset from the Query based on the stored
'QueryDef.
Set Rs = Qd.OpenRecordse t()

'This loop will collect the field names and place them in the
first
'row starting at "A1."
For i = 0 To Rs.Fields.Count - 1
Ws.Cells(1, i + 1).Value = Rs.Fields(i).Na me
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cel ls(1, 1), Ws.Cells(1, Rs.Fields.Count )).Font.Bold
_
=True

'The next line will get the data from the recordset and copy it
'into the Worksheet (Sheet1).

Ws.Range("A2"). CopyFromRecords et Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1" ).Select
Range("A1").Sel ect
Selection.Curre ntRegion.Select
Selection.Colum ns.AutoFit
Range("A1").Sel ect

Qd.Close
Rs.Close
Db.Close

End Sub

Where do i attach this code to? at which field? which event?
kev wrote:
>Hi Allen,

I really hope you can teach me about recordsets-how to create it and
OpenRecordse t.
Please help as i am a fresh beginner starting from zero knowledge about
this.

And also, i came across the article "How to retrieve a querydef from Ms
Access using DAO".
Will this method solve my existing problem?

Thanks a million!

Allen Browne wrote:
Kev, bear in mind that we don't know:
- how many tables are involved,
- what primary keys and foreign keys are involved,
- how you submit the data,
- how you retrieve the data and populate the controls on your unbound
form.

It is therefore impossible to advise you on what process you need.

The example below illustrates how to use an Append query statement to
write
a record to a table, and then retrieve the AutoNumber value. Hopefully
you
know how to OpenRecordset on that particular record from there, and you
can
also apply the same approach to the related tables where the answers to
the
individual questions in your survery are presumably stored. Note that
this
requires at least Access 2000.

Function ShowIdentity() As Variant
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine(0)(0)
db.Execute "INSERT INTO MyTable ( MyField ) SELECT 'nuffin' AS
Expr1;"

Set rs = db.OpenRecordse t("SELECT @@IDENTITY AS LastID;")
ShowIdentity = rs!LastID
rs.Close

Set rs = Nothing
Set db = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hi Allen,

Thank you for a quick reply but i am still not getting the solution
for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)

I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the
database.

Pls reply asap as my project relies very much on this..

Thanks again and sorry for any inconveniences caused

Allen Browne wrote:
Kev, you have not told us why you are doing this the hard way.

Just create a form bound to your table. There is no need for any
code,
button, or tying to retrieve the data. You can use the built-in
navigation
buttons at the bottom of the form to move to a new record, enter it,
and
it
saves and displays without any code.

"kev" <ke******@gmail .comwrote in message
news:11******* **************@ j72g2000cwa.goo glegroups.com.. .

I have created a database for equipments. I have a form to
register the
equipment meaning filling in all the particulars (ID, serial,
type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem
here
is i need to retrieve back the information submitted to display
all the
data that the user has input in something like

*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia

Please help as i need to do it urgently and am running out of
time.

Thanks a lot!!

Dec 7 '06 #7
kev
Hi Allen,

Can you elaborate more on the bound form.
I did create a bound form for registration and when the user clicks
submit, it saves into the corresponding Equipment table. After
submitting this record, user moves on to another page whereby i want to
display the summary (perhaps just two or three fields) and then user
proceeds to second level of registration..

Extremely sorry for bothering but i have no idea what to do next adn i
have been stuck on this for more than a week.

Thanks a zillion!

Allen Browne wrote:
Learning to handle recordsets is a bigger topic than we can achieve in a
newsgroup posting.

The function you postded seems to be connecting to spreadsheets, so is not
typical of recordsets in Access.

Recordsets use DAO or ADO. DAO is the native library in Access.

Again, and particularly if recordsets are new to you, I would encourage you
to review why you are wanting to program all this. It would be much better
to learn how to use the interface Access provides. Bound forms can do the
whole job for you. You can adapt them to what you need to achieve.

That's probably as far as I can take you on this one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Sorry ..forget to include this code in:
Sub GetQueryDef()
'This sub will get data from an Existing QueryDef in the
Northwind
'database and place the data on sheet2.

Dim Db As Database
Dim Qd As QueryDef
Dim Rs As Recordset
Dim Ws As Object
Dim i As Integer
Dim Path as String

'Set the Path to the database. This line is useful because
'if your database is in another location, you just need to change
'it here and the Path Variable will be used throughout the code.
'
'If you're using Microsoft Office 97, the line should read:
'
'Path = "C:\Program Files\Microsoft
'Office\Office\ Samples\Northwi nd.mdb"
'
Path = "C:\Msoffice\Ac cess\Samples\No rthwind.mdb"

'Set Ws
Set Ws = Sheets("Sheet1" )

'This set of code will activate Sheet1 and clear any existing
data.
'After clearing the data, it will select cell A1.
Ws.Activate
Range("A1").Act ivate
Selection.Curre ntRegion.Select
Selection.Clear Contents
Range("A1").Sel ect

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).O penDatabase(Pat h, ReadOnly:=True, _
Exclusive:=Fals e)
Set Qd = Db.QueryDefs("I nvoices")

'Create a new Recordset from the Query based on the stored
'QueryDef.
Set Rs = Qd.OpenRecordse t()

'This loop will collect the field names and place them in the
first
'row starting at "A1."
For i = 0 To Rs.Fields.Count - 1
Ws.Cells(1, i + 1).Value = Rs.Fields(i).Na me
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cel ls(1, 1), Ws.Cells(1, Rs.Fields.Count )).Font.Bold
_
=True

'The next line will get the data from the recordset and copy it
'into the Worksheet (Sheet1).

Ws.Range("A2"). CopyFromRecords et Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1" ).Select
Range("A1").Sel ect
Selection.Curre ntRegion.Select
Selection.Colum ns.AutoFit
Range("A1").Sel ect

Qd.Close
Rs.Close
Db.Close

End Sub

Where do i attach this code to? at which field? which event?
kev wrote:
Hi Allen,

I really hope you can teach me about recordsets-how to create it and
OpenRecordset.
Please help as i am a fresh beginner starting from zero knowledge about
this.

And also, i came across the article "How to retrieve a querydef from Ms
Access using DAO".
Will this method solve my existing problem?

Thanks a million!

Allen Browne wrote:
Kev, bear in mind that we don't know:
- how many tables are involved,
- what primary keys and foreign keys are involved,
- how you submit the data,
- how you retrieve the data and populate the controls on your unbound
form.

It is therefore impossible to advise you on what process you need.

The example below illustrates how to use an Append query statement to
write
a record to a table, and then retrieve the AutoNumber value. Hopefully
you
know how to OpenRecordset on that particular record from there, and you
can
also apply the same approach to the related tables where the answers to
the
individual questions in your survery are presumably stored. Note that
this
requires at least Access 2000.

Function ShowIdentity() As Variant
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = DBEngine(0)(0)
db.Execute "INSERT INTO MyTable ( MyField ) SELECT 'nuffin' AS
Expr1;"

Set rs = db.OpenRecordse t("SELECT @@IDENTITY AS LastID;")
ShowIdentity = rs!LastID
rs.Close

Set rs = Nothing
Set db = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"kev" <ke******@gmail .comwrote in message
news:11******** **************@ f1g2000cwa.goog legroups.com...
Hi Allen,
>
Thank you for a quick reply but i am still not getting the solution
for
my problem.
Let me explain again.
Once the user have filled in up the equipment registration form then
click submit, i want the data inputted shown in the next page/form.
I want only the current record to be displayed and not all records...
i have disabled the built-in navigation buttons as i only want one
record to be displayed at one time.(i do not want the user to view
other records)
>
I did use the method you suggested below but it is not displaying the
correct record instead it shows any record at random from the
database.
>
Pls reply asap as my project relies very much on this..
>
Thanks again and sorry for any inconveniences caused
>
Allen Browne wrote:
>Kev, you have not told us why you are doing this the hard way.
>>
>Just create a form bound to your table. There is no need for any
>code,
>button, or tying to retrieve the data. You can use the built-in
>navigation
>buttons at the bottom of the form to move to a new record, enter it,
>and
>it
>saves and displays without any code.
>>
>"kev" <ke******@gmail .comwrote in message
>news:11******* **************@ j72g2000cwa.goo glegroups.com.. .
>
I have created a database for equipments. I have a form to
register the
equipment meaning filling in all the particulars (ID, serial,
type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My problem
here
is i need to retrieve back the information submitted to display
all the
data that the user has input in something like
>
*Thank you for submitting.
Your details submitted is as below
id:00125
name:machine
location:malays ia
>
Please help as i need to do it urgently and am running out of
time.
>
Thanks a lot!!
Dec 7 '06 #8
On 7 Dec 2006 01:46:23 -0800, "kev" <ke******@gmail .comwrote:

Allen is right. You are a rookie. Stay with the basics and use Access
how it was designed to be used.

Move to the Summary page: DoCmd.Openform "frmSummary "
(or whatever your summary form is called). Don't try to do it all in
one form.

-Tom.

>Hi Allen,

Can you elaborate more on the bound form.
I did create a bound form for registration and when the user clicks
submit, it saves into the corresponding Equipment table. After
submitting this record, user moves on to another page whereby i want to
display the summary (perhaps just two or three fields) and then user
proceeds to second level of registration..

Extremely sorry for bothering but i have no idea what to do next adn i
have been stuck on this for more than a week.

Thanks a zillion!
<clip>

Dec 7 '06 #9
i got to see ur mail a few minuite ago send to me ur full email address
to is********@gmai l.com or me*********@gma il.com and i will post u the
source code we could also chat on yahoo tomorrow i am Nigerian 11:00 am
Nigerian Time, Hear from U soon. or i will post it here tomorrow i am
exhausted for now cheers and dont run out of time
*** Sent via Developersdex http://www.developersdex.com ***
Dec 7 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2056
by: Roar | last post by:
Hi! I have got 1 access 2000 DB, one simple search form, and 3 .asp pages (one for deleting a record, one for inserting a record and one for listing searchresults). Deleting records works fine, Inserting records works fine, but my headache is the searchform.. Whatever i type in the searchbox (sok), the result is all database entries, not just the entries matching the term I'm asking for. No error code is given.The code for the search is...
5
11555
by: Rich Protzel | last post by:
Hello, If I run an action SP from MS Access using ADO: ... cmd.execute where the SP is something like Create... Update tbl1 set fld1 = 'something' where... how can I retrive the count of records affected like from Query
1
2481
by: Neil | last post by:
Hello everyone, I am making a program at the moment, and need HELP!!!. I'll start with the database, my field's r: fldSku - which a 6 digit number, no more no less (145682) fldDescription - which is the description of a clothing fldLabel - Which is the band name of the clothing and fldPrice. k, what i need to do is, when i search for a SKU (which might have duplicates) in the db, i want it to return it to a datagrid on the form, and plus...
12
12258
by: jaYPee | last post by:
I have currently using a dataset to access my data from sql server 2000. The dataset contains 3 tables that is related to each other. parent/child/grandchild relationship. My problem is it's very slow to retrieve records from sql server. I'm using sqldataadapter.fill method to populate dataset. Parent table contains more than 3,000 records and child table contains more than 10,000 records and grandchild table contains more than 90,000...
0
1638
by: padhuwork | last post by:
Hi, I want to create a Windows DLL using VC++ 6.0 which connects to SQL Server. After establishing the connection, I want to retrieve records from table (query) and out put the recordset to a text file. Can you any expert, give me ideas as to how to go about? I have used the following code for connection and connection is successful. I m able to insert records (i got the code from codeproject website). I was successfully able to insert...
4
3225
by: LetMeDoIt | last post by:
Greetings, I'm using ASP to retrieve from MSSQL and I then populate a table. After several months of successfull retrieves, this same code now bombs out. It turns out that if I clear out from SQL about 10,000 records, the retrieve is then successfull. Reading some of the posts, I believe I need to set the cache. If anyone can point out where that cache, it would be greatly appreciated...
14
3091
by: David | last post by:
Hi, I have a form on which a user can select a checkbox against a record. Each checkbox carries the RecordID of a product. ---------------------------------------------------------------- I am trying to print the following report:- Details for product 1
4
7555
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice number, service number and installation site. The users do not have to enter all the information for the search. Currently, for the Customer's Name Combo Box, the values are retrieved from the Information Table and when a user selects a name, the...
4
6889
by: questionit | last post by:
How do i retreive 10 rows from a table using SQL SELECT Names from Customers... how do i change it to retrieve only 'n' number of rows? Please suggest an easy method Thanks
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9284
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.