BRandy
|
| Posted: 04/30/2003, 10:17 AM |
|
Thanks for you help.
I added the code, i don't get any errors, but it doesn't put in the finishdate either.
what if i put the code on the submit button. so that the value of status id will already be defined as 3. Then the finishdate should just be added.
like on submit if status_id.value=3 then add finish date?
|
|
|
 |
Hamilton
|
| Posted: 04/30/2003, 10:26 AM |
|
Could you post your Before_Insert() code block, please. We'll sort this out right away. Reply within this post.
|
|
|
 |
BRandu
|
| Posted: 04/30/2003, 10:32 AM |
|
Here it is. I added a before insert event so it gave me errors until i took out the function.
'Custom Code @30-73254650
'// get the value of the picklist called 'status'
Dim vResult
vResult = custreq.status_id.value
'//check for mode
If custreq.editmode then
'//record is being updated
If vResult = 3 then custreq.finishdate.value = FormatDateTime(now(), vbShortDate)
Else
'//record is being added
'//do nothing.
End If
'End Custom Code
|
|
|
 |
Hamilton
|
| Posted: 04/30/2003, 10:53 AM |
|
I suggested that the code go into the Before_Insert event, but of course, if you are performing an update at that point (e.g, the record already exists) - then naturally, the code would go into the Before_Update event.
I placed your code within one of my modules (see below) to replicate what you're attempting, no errors resulted.
If this still doesn't fire for you - Post the error message as well.
Dim x : x = 3
Dim vResult
vResult = x 'custreq.status_id.value
'//check for mode
If PT_Enhancements.editmode then
'//record is being updated
If vResult = 3 then PT_Enhancements.finishdate.value = FormatDateTime(now(), vbShortDate)
Else
'//record is being added
'//do nothing.
End If
|
|
|
 |
Brandy
|
| Posted: 04/30/2003, 11:29 AM |
|
that worked great!!!!
Last Problem is i created 2 record pages.
1 is the orginal record page that was linked to the grid page. Editable by people with rights to click on links on the grid.
2 is where the assign by puts in there information, but most i have put default values in and put them to disabled or read only.
How can i link 2 to the grid so that when i input the data it will show up on the grid?
I am having trouble linking
|
|
|
 |
Hamilton
|
| Posted: 04/30/2003, 12:07 PM |
|
Brandy,
What are you saying? You really need to take a moment and explain things more clearly. Nevertheless, I'll try.... [but I have to make assumptions, now]
Here's what I'm reading into your statement.
You have a page with a grid - call it gridPage.
You have a page with a record - call it recordPage1
You have a page with a record - call it recordPage2
Persons with applicable rights can access each page according to their rights.
The Grid contains a click-able link that takes the user to recordPage1
But you need another click-able link that takes the user to recordPage2?
Is that it?
If so, you could
A) Add another link and set it's page to recordPage2
OR
b) Add a label field (I'll call it lblLink2) and on the Before_show event - 'add code'
It might look like this
Function Before_Show()
Dim lngID
Dim strTitle
Dim href
lngID = formpage.Datasource.recordset.fields("ID")
strTitle = formpage.Datasource.recordset.fields("applicable field name")
href = "<a href=""recordPage2.asp?id=" & lngID & "">" & strTitle & "</a>"
formpage.lblLink2.value = href
End Function
I may be off base here - as your question is not very well laid out. Nevertheless, take note of the method I've just given as it's applicable to a number of scenario's you'll encounter.
|
|
|
 |
Brandy
|
| Posted: 04/30/2003, 1:33 PM |
|
What i meant was. If create a grid/search and record page using the application builder both pages are linked to each other. So when i input data into the record field it shows up in the grid.
Now with that said, I have created a second record page using the application builder. I didn't create another search or grid, i only created the builder. I wanted to link it to the grid i created in the first paragraph.
But when i put information in it doesn't display it on the grid.
When i put info in the first one that i made with the grid it all works great.
When i put info into the stand alone record page it doesn't insert the information in the grid. It put the info in the access database but doesn't display it on the grid.
Does that make more sense?
I apologize i am horrible at typing things out in explanation.
you can e-mail me atbjohnson@brazoselectric.com if you like.
thanks again for all your help :)
|
|
|
 |
|