By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

how to retrieve records submmited on a form

P: n/a
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:malaysia

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

Thanks a lot!!

Dec 7 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
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*********************@j72g2000cwa.googlegro ups.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:malaysia

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

Thanks a lot!!

Dec 7 '06 #2

P: n/a
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*********************@j72g2000cwa.googlegro ups.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:malaysia

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

Thanks a lot!!
Dec 7 '06 #3

P: n/a
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.OpenRecordset("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.googlegro ups.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.googlegr oups.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:malaysia

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

Thanks a lot!!

Dec 7 '06 #4

P: n/a
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.OpenRecordset("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.googlegro ups.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.googlegro ups.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:malaysia

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

Thanks a lot!!
Dec 7 '06 #5

P: n/a
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\Northwind.mdb"
'
Path = "C:\Msoffice\Access\Samples\Northwind.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").Activate
Selection.CurrentRegion.Select
Selection.ClearContents
Range("A1").Select

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).OpenDatabase(Path, ReadOnly:=True, _
Exclusive:=False)
Set Qd = Db.QueryDefs("Invoices")

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

'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).Name
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cells(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").CopyFromRecordset Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1").Select
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Columns.AutoFit
Range("A1").Select

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.OpenRecordset("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.googlegro ups.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.googlegr oups.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:malaysia
>
Please help as i need to do it urgently and am running out of time.
>
Thanks a lot!!
Dec 7 '06 #6

P: n/a
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.googlegro ups.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\Northwind.mdb"
'
Path = "C:\Msoffice\Access\Samples\Northwind.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").Activate
Selection.CurrentRegion.Select
Selection.ClearContents
Range("A1").Select

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).OpenDatabase(Path, ReadOnly:=True, _
Exclusive:=False)
Set Qd = Db.QueryDefs("Invoices")

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

'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).Name
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cells(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").CopyFromRecordset Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1").Select
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Columns.AutoFit
Range("A1").Select

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.OpenRecordset("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.googlegro ups.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.googlegr oups.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:malaysia

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

Thanks a lot!!

Dec 7 '06 #7

P: n/a
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.googlegro ups.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\Northwind.mdb"
'
Path = "C:\Msoffice\Access\Samples\Northwind.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").Activate
Selection.CurrentRegion.Select
Selection.ClearContents
Range("A1").Select

'Set the Database and QueryDef. This QueryDef exists in the
'database.
Set Db = Workspaces(0).OpenDatabase(Path, ReadOnly:=True, _
Exclusive:=False)
Set Qd = Db.QueryDefs("Invoices")

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

'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).Name
Next

'This line simply sets the font to bold for the headers.
Ws.Range(Ws.Cells(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").CopyFromRecordset Rs

'This next code set will just select the data region and auto-fit
'the columns
Sheets("Sheet1").Select
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Columns.AutoFit
Range("A1").Select

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.OpenRecordset("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.googlegro ups.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.googlegr oups.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:malaysia
>
Please help as i need to do it urgently and am running out of
time.
>
Thanks a lot!!
Dec 7 '06 #8

P: n/a
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

P: n/a
i got to see ur mail a few minuite ago send to me ur full email address
to is********@gmail.com or me*********@gmail.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

P: n/a
kev
Hi Nyada,

Hope you could send me the source code asap as my project is currently
on hold for this.
Or you could mail to me at ke******@gmail.com

Thanks in advance for your help.

Nyada Ishaya Okem wrote:
i got to see ur mail a few minuite ago send to me ur full email address
to is********@gmail.com or me*********@gmail.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 8 '06 #11

P: n/a
kev
Hi Tom,

I think you don't quite get me here.
I have created a frm Summary which will open right after the
registration.
My problem is still the same, my frmSummary must show the summary of
registration but how?
I created frmSummary bound to the Equipment table(record source) but
the summary show records of other users registration as well.

How to make it show oni the current registration record?
Please help to explain in detail if possible provide the source code as
well.

btw, DoCmd.Openform "frmSummary" is attached to the submit button
right?
Lots of thanks.

Tom van Stiphout wrote:
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 8 '06 #12

P: n/a
On 7 Dec 2006 17:34:46 -0800, "kev" <ke******@gmail.comwrote:

Check DoCmd.OpenForm in the help file. It has an additional argument
"strWhere". You could supply:
"EquipmentID = " & Forms!frmRegistration!EquipmentID
If EquipmentID is text, put single quotes around it like this:
"EquipmentID = '" & Forms!frmRegistration!EquipmentID & "'"

Sorry, my first paragraph was a bit harsh upon second reading. I
didn't mean to offend you. Rookies are very welcome here.

-Tom.

>Hi Tom,

I think you don't quite get me here.
I have created a frm Summary which will open right after the
registration.
My problem is still the same, my frmSummary must show the summary of
registration but how?
I created frmSummary bound to the Equipment table(record source) but
the summary show records of other users registration as well.

How to make it show oni the current registration record?
Please help to explain in detail if possible provide the source code as
well.

btw, DoCmd.Openform "frmSummary" is attached to the submit button
right?
Lots of thanks.

Tom van Stiphout wrote:
>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 8 '06 #13

P: n/a
kev
Hi Tom,

Thanks a lot on your help. My frmRegistration can display the correct
value on frmSummary.
You are the best man!
Thanks again..

Tom van Stiphout wrote:
On 7 Dec 2006 17:34:46 -0800, "kev" <ke******@gmail.comwrote:

Check DoCmd.OpenForm in the help file. It has an additional argument
"strWhere". You could supply:
"EquipmentID = " & Forms!frmRegistration!EquipmentID
If EquipmentID is text, put single quotes around it like this:
"EquipmentID = '" & Forms!frmRegistration!EquipmentID & "'"

Sorry, my first paragraph was a bit harsh upon second reading. I
didn't mean to offend you. Rookies are very welcome here.

-Tom.

Hi Tom,

I think you don't quite get me here.
I have created a frm Summary which will open right after the
registration.
My problem is still the same, my frmSummary must show the summary of
registration but how?
I created frmSummary bound to the Equipment table(record source) but
the summary show records of other users registration as well.

How to make it show oni the current registration record?
Please help to explain in detail if possible provide the source code as
well.

btw, DoCmd.Openform "frmSummary" is attached to the submit button
right?
Lots of thanks.

Tom van Stiphout wrote:
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 8 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.